Skip to content

Commit df618fb

Browse files
benschermelJohnSully
authored andcommitted
include support for dists < dh11
1 parent 94acd43 commit df618fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1670
-6
lines changed

pkg/deb/deb-buildsource.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ cd ../../../
2626
tar -czvf keydb_$version.orig.tar.gz --force-local KeyDB
2727
cd KeyDB/pkg/deb/
2828
mkdir -p $pkg_name/tmp
29-
cp -r debian $pkg_name/tmp
29+
if [ "$codename" == "xenial" ]; then
30+
cp -r debian_dh9 $pkg_name/tmp/debian
31+
else
32+
cp -r debian $pkg_name/tmp
33+
fi
3034
cp master_changelog $pkg_name/tmp/debian/changelog
3135
mv ../../../keydb_$version.orig.tar.gz ./$pkg_name
3236
cd $pkg_name/tmp

pkg/deb/debian/control

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ Build-Depends:
66
debhelper (>= 9~),
77
dpkg-dev (>= 1.17.5),
88
systemd,
9-
# libhiredis-dev (>= 0.14.0),
10-
# libjemalloc-dev [linux-any],
11-
# liblua5.1-dev,
12-
# lua-bitop-dev,
13-
# lua-cjson-dev,
149
procps <!nocheck>,
1510
build-essential <!nocheck>,
1611
tcl <!nocheck>,

pkg/deb/debian_dh9/NEWS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
keydb (4:4.0.2-3) unstable; urgency=medium
2+
3+
This version drops the Debian-specific support for the
4+
/etc/keydb/keydb-{server,sentinel}.{pre,post}-{up,down}.d directories in
5+
favour of using systemd's ExecStartPre, ExecStartPost, ExecStopPre,
6+
ExecStopPost commands.
7+
8+
-- Chris Lamb <[email protected]> Wed, 11 Oct 2017 22:55:00 -0400
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- sh -*-
2+
#
3+
# Bash completion function for the 'keydb-cli' command.
4+
#
5+
# Steve
6+
# --
7+
# http://www.steve.org.uk
8+
#
9+
10+
_keydb-cli()
11+
{
12+
COMPREPLY=()
13+
cur=${COMP_WORDS[COMP_CWORD]}
14+
prev=${COMP_WORDS[COMP_CWORD-1]}
15+
16+
#
17+
# All known commands accepted. Sorted.
18+
#
19+
opts='bgrewriteaof bgsave dbsize debug decr decrby del echo exists expire expireat flushall flushdb get getset incr incrby info keys lastsave lindex llen lpop lpush lrange lrem lset ltrim mget move mset msetnx ping randomkey rename renamenx rewriteaof rpop rpoplpush rpush sadd save scard sdiff sdiffstore select set setnx shutdown sinter sinterstore sismember slaveof smembers smove sort spop srandmember srem sunion sunionstore ttl type zadd zcard zincrby zrange zrangebyscore zrem zremrangebyscore zrevrange zscore'
20+
21+
#
22+
# Only complete on the first term.
23+
#
24+
if [ $COMP_CWORD -eq 1 ]; then
25+
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
26+
return 0
27+
fi
28+
29+
}
30+
complete -F _keydb-cli keydb-cli
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
#!/bin/sh
2+
3+
SYSTEMD_VER=$(systemctl --version | head -1 | cut -d' ' -f2)
4+
5+
if [ ${SYSTEMD_VER} -lt 237 ]
6+
then
7+
SYSTEMD_EXTRA=""
8+
else
9+
SYSTEMD_EXTRA=$(cat <<EOF
10+
11+
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
12+
#MemoryDenyWriteExecute=true
13+
ProtectKernelModules=true
14+
ProtectKernelTunables=true
15+
ProtectControlGroups=true
16+
RestrictRealtime=true
17+
RestrictNamespaces=true
18+
EOF
19+
)
20+
fi
21+
22+
for BINARY in keydb-server keydb-sentinel
23+
do
24+
for MODE in default templated
25+
do
26+
case "${BINARY}" in
27+
keydb-server)
28+
NAME="keydb"
29+
;;
30+
keydb-sentinel)
31+
NAME="sentinel"
32+
;;
33+
esac
34+
35+
case "${MODE}" in
36+
default)
37+
EXTRA="Alias=${NAME}.service"
38+
TARGET="debian/${BINARY}.service"
39+
NAMESPACED="${NAME}"
40+
DESCRIPTION="Advanced key-value store"
41+
;;
42+
templated)
43+
EXTRA=""
44+
TARGET="debian/${BINARY}@.service"
45+
NAMESPACED="${NAME}-%i"
46+
DESCRIPTION="Advanced key-value store (%I)"
47+
;;
48+
esac
49+
50+
: >${TARGET}
51+
52+
if [ "${MODE}" = "templated" ]
53+
then
54+
cat >> ${TARGET} <<EOF
55+
# Templated service file for ${BINARY}(1)
56+
#
57+
# Each instance of ${BINARY} requires its own configuration file:
58+
#
59+
# $ cp /etc/keydb/${NAME}.conf /etc/keydb/${NAME}-myname.conf
60+
# $ chown keydb:keydb /etc/keydb/${NAME}-myname.conf
61+
#
62+
# Ensure each instance is using their own database:
63+
#
64+
# $ sed -i -e 's@^dbfilename .*@dbfilename dump-myname.rdb@' /etc/keydb/${NAME}-myname.conf
65+
#
66+
# We then listen exlusively on UNIX sockets to avoid TCP port collisions:
67+
#
68+
# $ sed -i -e 's@^port .*@port 0@' /etc/keydb/${NAME}-myname.conf
69+
# $ sed -i -e 's@^\\(# \\)\\{0,1\\}unixsocket .*@unixsocket /var/run/${NAME}-myname/${BINARY}.sock@' /etc/keydb/${NAME}-myname.conf
70+
#
71+
# ... and ensure we are logging, etc. in a unique location:
72+
#
73+
# $ sed -i -e 's@^logfile .*@logfile /var/log/keydb/${BINARY}-myname.log@' /etc/keydb/${NAME}-myname.conf
74+
# $ sed -i -e 's@^pidfile .*@pidfile /var/run/keydb-myname/${BINARY}.pid@' /etc/keydb/${NAME}-myname.conf
75+
#
76+
# We can then start the service as follows, validating we are using our own
77+
# configuration:
78+
#
79+
# $ systemctl start ${BINARY}@myname.service
80+
# $ keydb-cli -s /var/run/${NAME}-myname/${BINARY}.sock info | grep config_file
81+
#
82+
# -- Chris Lamb <[email protected]> Mon, 09 Oct 2017 22:17:24 +0100
83+
EOF
84+
fi
85+
86+
cat >> ${TARGET} <<EOF
87+
[Unit]
88+
Description=${DESCRIPTION}
89+
After=network.target
90+
Documentation=https://docs.keydb.dev, man:${BINARY}(1)
91+
92+
[Service]
93+
Type=forking
94+
ExecStart=/usr/bin/${BINARY} /etc/keydb/${NAMESPACED}.conf
95+
ExecStop=/bin/kill -s TERM \$MAINPID
96+
PIDFile=/var/run/${NAMESPACED}/${BINARY}.pid
97+
TimeoutStopSec=0
98+
Restart=always
99+
User=keydb
100+
Group=keydb
101+
RuntimeDirectory=${NAMESPACED}
102+
RuntimeDirectoryMode=2755
103+
104+
UMask=007
105+
PrivateTmp=yes
106+
LimitNOFILE=65535
107+
PrivateDevices=yes
108+
ProtectHome=yes
109+
ReadOnlyDirectories=/
110+
ReadWriteDirectories=-/var/lib/keydb
111+
ReadWriteDirectories=-/var/log/keydb
112+
ReadWriteDirectories=-/var/run/${NAMESPACED}
113+
114+
NoNewPrivileges=true
115+
CapabilityBoundingSet=CAP_SETGID CAP_SETUID CAP_SYS_RESOURCE${SYSTEMD_EXTRA}
116+
117+
# ${BINARY} can write to its own config file when in cluster mode so we
118+
# permit writing there by default. If you are not using this feature, it is
119+
# recommended that you replace the following lines with "ProtectSystem=full".
120+
ProtectSystem=true
121+
ReadWriteDirectories=-/etc/keydb
122+
123+
[Install]
124+
WantedBy=multi-user.target
125+
EOF
126+
if [ "${EXTRA}" != "" ]
127+
then
128+
echo "${EXTRA}" >> "${TARGET}"
129+
fi
130+
done
131+
done

pkg/deb/debian_dh9/changelog

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
keydb (5:5.3.3-1~bionic1) bionic; urgency=medium
2+
3+
* 5.3.3 Updating deb source package and naming convention.
4+
5+
-- Ben Schermel <[email protected]> Fri, 25 Oct 2019 8:00:37 +0000
6+
7+
keydb (5:5.1.12-1chl1~bionic1) bionic; urgency=medium
8+
9+
* 5.1.1 update. This update fixes several rare deadlock scenarios. Deadlock detection is also added.
10+
11+
-- Ben Schermel <[email protected]> Fri, 25 Oct 2019 8:00:37 +0000
12+
13+
14+
keydb (5:5.1.11-1chl1~bionic1) bionic; urgency=medium
15+
16+
* 5.1 release. This release includes subkey expires (EXPIREMEMBER/EXPIREMEMBERAT), with updates to PTTL/TTL accordingly. New OBJECT LASTMODIFIED, BITIOP LSHIFT & BITOP RSHIFT commands. See https://docs.keydb.dev/blog/2019/10/20/blog-post/ for detailed review of release.
17+
18+
-- Ben Schermel <[email protected]> Mon, 21 Oct 2019 8:00:37 +0000
19+
20+
21+
keydb (5:5.0.1-1chl1~bionic1) bionic; urgency=medium
22+
23+
* Arm build now included for bionic package
24+
25+
-- Ben Schermel <[email protected]> Wed, 21 Aug 2019 22:58:37 +0000
26+
27+
28+
keydb (5:5.0.0-1chl1~bionic1) bionic; urgency=medium
29+
30+
* Initial release of KeyDB PPA. This PPA was originally derived from https://launchpad.net/~chris-lea/+archive/ubuntu/redis-server
31+
32+
-- Ben Schermel <[email protected]> Wed, 21 Aug 2019 2:58:37 +0000

pkg/deb/debian_dh9/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

pkg/deb/debian_dh9/control

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
Source: keydb
2+
Section: database
3+
Priority: optional
4+
Maintainer: Ben Schermel <[email protected]>
5+
Build-Depends:
6+
debhelper (>= 9~),
7+
dpkg-dev (>= 1.17.5),
8+
systemd,
9+
procps <!nocheck>,
10+
build-essential <!nocheck>,
11+
tcl <!nocheck>,
12+
tcl-dev <!nocheck>,
13+
uuid-dev <!nocheck>,
14+
libcurl4-openssl-dev <!nocheck>,
15+
nasm <!nocheck>,
16+
autotools-dev <!nocheck>,
17+
autoconf <!nocheck>,
18+
libjemalloc-dev <!nocheck>,
19+
libssl-dev <!nocheck>
20+
Standards-Version: 4.2.1
21+
Homepage: https://docs.keydb.dev/
22+
Vcs-Git: https://github.com/JohnSully/KeyDB.git
23+
Vcs-Browser: https://github.com/JohnSully/KeyDB
24+
25+
Package: keydb
26+
Architecture: all
27+
Depends:
28+
keydb-server (<< ${binary:Version}.1~),
29+
keydb-server (>= ${binary:Version}),
30+
${misc:Depends},
31+
Description: Persistent key-value database with network interface (metapackage)
32+
keydb is a key-value database in a similar vein to memcache but the dataset
33+
is non-volatile. keydb additionally provides native support for atomically
34+
manipulating and querying data structures such as lists and sets.
35+
.
36+
The dataset is stored entirely in memory and periodically flushed to disk.
37+
.
38+
This package depends on the keydb-server package.
39+
40+
Package: keydb-sentinel
41+
Architecture: any
42+
Depends:
43+
lsb-base (>= 3.2-14),
44+
keydb-tools (= ${binary:Version}),
45+
${misc:Depends},
46+
Description: Persistent key-value database with network interface (monitoring)
47+
keydb is a key-value database in a similar vein to memcache but the dataset
48+
is non-volatile. keydb additionally provides native support for atomically
49+
manipulating and querying data structures such as lists and sets.
50+
.
51+
This package contains the keydb Sentinel monitoring software.
52+
53+
Package: keydb-server
54+
Architecture: any
55+
Depends:
56+
lsb-base (>= 3.2-14),
57+
keydb-tools (= ${binary:Version}),
58+
${misc:Depends},
59+
Description: Persistent key-value database with network interface
60+
keydb is a key-value database in a similar vein to memcache but the dataset
61+
is non-volatile. keydb additionally provides native support for atomically
62+
manipulating and querying data structures such as lists and sets.
63+
.
64+
The dataset is stored entirely in memory and periodically flushed to disk.
65+
66+
Package: keydb-tools
67+
Architecture: any
68+
Depends:
69+
adduser,
70+
${misc:Depends},
71+
${shlibs:Depends},
72+
Description: Persistent key-value database with network interface (client)
73+
keydb is a key-value database in a similar vein to memcache but the dataset
74+
is non-volatile. keydb additionally provides native support for atomically
75+
manipulating and querying data structures such as lists and sets.
76+
.
77+
This package contains the command line client and other tools.

0 commit comments

Comments
 (0)