Merge ~chris.macnaughton/ubuntu/+source/swift:master into ~ubuntu-server-dev/ubuntu/+source/swift:master

Proposed by Chris MacNaughton
Status: Merged
Merged at revision: 09bc1fc74977767ced1243ea1191a4c68de7e2a1
Proposed branch: ~chris.macnaughton/ubuntu/+source/swift:master
Merge into: ~ubuntu-server-dev/ubuntu/+source/swift:master
Diff against target: 2230 lines (+684/-33)
29 files modified
debian/changelog (+12/-0)
debian/gen-init (+93/-0)
debian/init-script-template (+148/-0)
debian/rules (+22/-13)
debian/swift-account-generator (+32/-0)
debian/swift-account.install (+3/-0)
debian/swift-account.swift-account-auditor.init.in (+17/-0)
debian/swift-account.swift-account-reaper.init.in (+17/-0)
debian/swift-account.swift-account-replicator.init.in (+17/-0)
debian/swift-account.swift-account.init.in (+17/-0)
debian/swift-container-generator (+32/-0)
debian/swift-container.install (+3/-0)
debian/swift-container.swift-container-auditor.init.in (+17/-0)
debian/swift-container.swift-container-reconciler.init.in (+16/-0)
debian/swift-container.swift-container-replicator.init.in (+17/-0)
debian/swift-container.swift-container-sharder.init.in (+17/-0)
debian/swift-container.swift-container-sync.init.in (+17/-0)
debian/swift-container.swift-container-updater.init.in (+17/-0)
debian/swift-container.swift-container.init.in (+17/-0)
debian/swift-object-expirer.swift-object-expirer.init.in (+16/-0)
debian/swift-object-generator (+32/-0)
debian/swift-object.install (+3/-0)
debian/swift-object.swift-object-auditor.init.in (+17/-0)
debian/swift-object.swift-object-reconstructor.init.in (+17/-0)
debian/swift-object.swift-object-replicator.init.in (+17/-0)
debian/swift-object.swift-object-updater.init.in (+17/-0)
debian/swift-object.swift-object.init.in (+17/-0)
debian/swift-proxy.swift-proxy.init.in (+17/-0)
dev/null (+0/-20)
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+385815@code.launchpad.net
To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :

Please can you also reference bug 1827340 in the changelog.

review: Needs Fixing
Revision history for this message
James Page (james-page) :
Revision history for this message
James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 5753e39..611ff90 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,15 @@
6+swift (2.25.0-0ubuntu2) UNRELEASED; urgency=medium
7+
8+ * Update to use Systemd unit files (LP: #1827340, LP: #1800676)
9+ * d/*.init.in: Import init script (systemd) generation from Debian.
10+ * d/*.upstart: Removed.
11+ * d/*.init: Removed
12+ * d/*.generator: Import from Debian.
13+ * d/*.install: Added reference to generator files
14+ * d/gen-init: Import from Debian. Remove WorkingDirectory.
15+
16+ -- Chris MacNaughton <chris.macnaughton@canonical.com> Thu, 11 Jun 2020 09:43:34 +0000
17+
18 swift (2.25.0-0ubuntu1) groovy; urgency=medium
19
20 * New upstream release for OpenStack Ussuri (LP: #1877642).
21diff --git a/debian/gen-init b/debian/gen-init
22new file mode 100755
23index 0000000..5583fbf
24--- /dev/null
25+++ b/debian/gen-init
26@@ -0,0 +1,93 @@
27+#!/bin/sh
28+
29+INIT_TEMPLATE=${1}
30+
31+# Get the variables defined in the init template
32+. ${INIT_TEMPLATE}
33+
34+SYSTEM_USER=${PROJECT_NAME}
35+SYSTEM_GROUP=${PROJECT_NAME}
36+
37+# Find out what should go in After=
38+SHOULD_START=`cat ${INIT_TEMPLATE} | grep "# Should-Start:" | sed 's/# Should-Start://'`
39+
40+INIT_FILE=`echo ${INIT_TEMPLATE} | sed 's/.init.in/.init/'`
41+SERVICE_FILE=`echo ${INIT_TEMPLATE} | sed 's/.init.in/.service/'`
42+
43+if [ -n "${SHOULD_START}" ] ; then
44+ AFTER="After="
45+ for i in ${SHOULD_START} ; do
46+ AFTER="${AFTER}${i}.service "
47+ done
48+fi
49+
50+if [ -n "$SYSTEMD_DOC" ] ; then
51+ SYSTEMD_DOC="Documentation=$SYSTEMD_DOC"
52+fi
53+
54+########
55+# init #
56+########
57+cp "$INIT_TEMPLATE" "$INIT_FILE"
58+cat debian/init-script-template >>"$INIT_FILE"
59+
60+###########
61+# systemd #
62+###########
63+echo "[Unit]
64+Description=${DESC}
65+ConditionFileNotEmpty=/etc/${PROJECT_NAME}/${CONFIG}.conf
66+AssertFileNotEmpty=/etc/swift/account.ring.gz
67+AssertFileNotEmpty=/etc/swift/container.ring.gz
68+AssertPathExistsGlob=/etc/swift/object*.ring.gz
69+$SYSTEMD_DOC
70+$AFTER
71+
72+[Service]
73+User=${SYSTEM_USER}
74+Group=${SYSTEM_GROUP}
75+CacheDirectory=${PROJECT_NAME}
76+RuntimeDirectory=${PROJECT_NAME} lock/${PROJECT_NAME}
77+ExecStart=/usr/bin/${NAME} /etc/${PROJECT_NAME}/${CONFIG}.conf
78+Restart=on-failure
79+LimitNOFILE=65535
80+
81+[Install]
82+WantedBy=multi-user.target
83+" >${SERVICE_FILE}
84+
85+##############################
86+
87+if [ "$MULTI" ] ; then
88+
89+SERVICE_FILE=`echo ${INIT_TEMPLATE} | sed 's/.init.in/@.service/'`
90+SERVICE_NAME=${INIT_TEMPLATE%.init.in}
91+SERVICE_NAME=${SERVICE_NAME##*/}
92+SERVICE_NAME=${SERVICE_NAME##*.}
93+
94+echo "[Unit]
95+Description=${DESC}
96+PartOf=${SERVICE_NAME}.service
97+ReloadPropagatedFrom=${SERVICE_NAME}.service
98+ConditionFileNotEmpty=/etc/${PROJECT_NAME}/${CONFIG}/%i.conf
99+AssertFileNotEmpty=/etc/swift/account.ring.gz
100+AssertFileNotEmpty=/etc/swift/container.ring.gz
101+AssertPathExistsGlob=/etc/swift/object*.ring.gz
102+$SYSTEMD_DOC
103+$AFTER
104+
105+[Service]
106+User=${SYSTEM_USER}
107+Group=${SYSTEM_GROUP}
108+WorkingDirectory=~
109+CacheDirectory=${PROJECT_NAME}
110+RuntimeDirectory=${PROJECT_NAME} lock/${PROJECT_NAME}
111+ExecStart=/usr/bin/${NAME} /etc/${PROJECT_NAME}/${CONFIG}/%i.conf
112+Restart=on-failure
113+LimitNOFILE=65535
114+
115+[Install]
116+WantedBy=multi-user.target
117+" >${SERVICE_FILE}
118+
119+fi
120diff --git a/debian/init-script-template b/debian/init-script-template
121new file mode 100644
122index 0000000..f94491b
123--- /dev/null
124+++ b/debian/init-script-template
125@@ -0,0 +1,148 @@
126+#!/bin/sh
127+# The content after this line comes from Debian Swift source package
128+# and has been automatically added to a .init.in script, which
129+# contains only the descriptive part for the daemon. Everything
130+# else is standardized as a single unique script.
131+
132+# Author: Thomas Goirand <zigo@debian.org>
133+# Author: Ondřej Nový <novy@ondrej.org>
134+
135+# PATH should only include /usr/* if it runs after the mountnfs.sh script
136+PATH=/sbin:/usr/sbin:/bin:/usr/bin
137+
138+DAEMON=/usr/bin/${NAME}
139+SYSTEM_USER=${PROJECT_NAME}
140+SYSTEM_GROUP=${PROJECT_NAME}
141+
142+# Exit if the package is not installed
143+[ -x $DAEMON ] || exit 0
144+
145+# If ran as root, create /var/lock/X, /var/run/X and /var/cache/X as needed
146+if [ `whoami` = "root" ] ; then
147+ for i in lock run cache ; do
148+ mkdir -p /var/$i/${PROJECT_NAME}
149+ chown ${SYSTEM_USER}:${SYSTEM_GROUP} /var/$i/${PROJECT_NAME}
150+ done
151+fi
152+
153+# This defines init_is_upstart which we use later on (+ more...)
154+. /lib/lsb/init-functions
155+
156+RET=0
157+
158+# Configs
159+[ -r /etc/default/openstack ] && . /etc/default/openstack
160+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
161+
162+do_start() {
163+ # Check for existence of ring files
164+ if
165+ [ ! -r /etc/swift/account.ring.gz ] ||
166+ [ ! -r /etc/swift/container.ring.gz ] ||
167+ test -z "$(find /etc/swift -maxdepth 1 -name 'object*.ring.gz' -print -quit)" ; then
168+ log_end_msg 1
169+ exit $?
170+ fi
171+
172+ STARTED=
173+ for CONF_FILE in /etc/swift/${CONFIG}.conf /etc/swift/${CONFIG}/*.conf ; do
174+ if [ ! -e "$CONF_FILE" ] ; then
175+ continue
176+ fi
177+
178+ SUFFIX=${CONF_FILE#/etc/swift/$CONFIG}
179+ SUFFIX=${SUFFIX%.conf}
180+ if [ "$SUFFIX" ] ; then
181+ # /etc/swift/${NAME}/*.conf
182+ SUFFIX=-${SUFFIX#/}
183+ fi
184+ PIDFILE=/var/run/${PROJECT_NAME}/${NAME}${SUFFIX}.pid
185+
186+ start-stop-daemon \
187+ --start \
188+ --quiet \
189+ --background \
190+ --chuid ${SYSTEM_USER}:${SYSTEM_GROUP} \
191+ --make-pidfile \
192+ --pidfile ${PIDFILE} \
193+ --chdir /var/lib/${PROJECT_NAME} \
194+ --startas $DAEMON \
195+ --test > /dev/null \
196+ || return 1
197+ start-stop-daemon \
198+ --start \
199+ --quiet \
200+ --background \
201+ --chuid ${SYSTEM_USER}:${SYSTEM_GROUP} \
202+ --make-pidfile \
203+ --pidfile ${PIDFILE} \
204+ --chdir /var/lib/${PROJECT_NAME} \
205+ --startas $DAEMON \
206+ -- $CONF_FILE \
207+ || return 2
208+
209+ STARTED=1
210+ done
211+
212+ if [ ! "$STARTED" ] ; then
213+ return 2
214+ fi
215+}
216+
217+do_stop() {
218+ for PIDFILE in /var/run/${PROJECT_NAME}/${NAME}*.pid ; do
219+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE
220+ RETVAL=$?
221+ rm -f $PIDFILE
222+ if [ "$RETVAL" != "0" ] ; then
223+ return "$RETVAL"
224+ fi
225+ done
226+}
227+
228+case "$1" in
229+start)
230+ #init_is_upstart > /dev/null 2>&1 && exit 1
231+ log_daemon_msg "Starting $DESC" "$NAME"
232+ do_start
233+ case $? in
234+ 0|1) log_end_msg 0 ; RET=$? ;;
235+ 2) log_end_msg 1 ; RET=$? ;;
236+ esac
237+;;
238+stop)
239+ #init_is_upstart > /dev/null 2>&1 && exit 0
240+ log_daemon_msg "Stopping $DESC" "$NAME"
241+ do_stop
242+ case $? in
243+ 0|1) log_end_msg 0 ; RET=$? ;;
244+ 2) log_end_msg 1 ; RET=$? ;;
245+ esac
246+;;
247+status)
248+ status_of_proc "$DAEMON" "$NAME"
249+ RET=$?
250+;;
251+restart|force-reload)
252+ #init_is_upstart > /dev/null 2>&1 && exit 1
253+ log_daemon_msg "Restarting $DESC" "$NAME"
254+ do_stop
255+ case $? in
256+ 0|1)
257+ do_start
258+ case $? in
259+ 0) log_end_msg 0 ; RET=$? ;;
260+ 1) log_end_msg 1 ; RET=$? ;; # Old process is still running
261+ *) log_end_msg 1 ; RET=$? ;; # Failed to start
262+ esac
263+ ;;
264+ *) log_end_msg 1 ; RET=$? ;; # Failed to stop
265+ esac
266+;;
267+*)
268+ echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2
269+ RET=3
270+;;
271+esac
272+
273+exit $RET
274diff --git a/debian/rules b/debian/rules
275index 407b4ef..611dbb1 100755
276--- a/debian/rules
277+++ b/debian/rules
278@@ -34,11 +34,18 @@ endif
279 get-orig-source:
280 uscan --verbose --force-download --rename --destdir=../build-area
281
282+override_dh_auto_build:
283+ dh_auto_build
284+ set -e ; set -x ; \
285+ for i in $(sort $(wildcard debian/*.init.in)) ; do \
286+ debian/gen-init $$i ; \
287+ done
288+
289 override_dh_auto_install:
290 pkgos-dh_auto_install --no-py2 --in-tmp
291
292 override_dh_install:
293- dh_install --sourcedir=debian/tmp
294+ dh_install --sourcedir=debian/tmp -Xdebian/swift-account-generator -Xdebian/swift-object-generator -Xdebian/swift-container-generator
295 dh_missing --fail-missing
296 install -D -m 0640 $(CURDIR)/debian/account-server.conf $(CURDIR)/debian/python3-swift/etc/swift/account-server.conf
297 install -D -m 0640 $(CURDIR)/debian/container-server.conf $(CURDIR)/debian/python3-swift/etc/swift/container-server.conf
298@@ -46,18 +53,20 @@ override_dh_install:
299 install -D -m 0640 $(CURDIR)/debian/object-expirer.conf $(CURDIR)/debian/python3-swift/etc/swift/object-expirer.conf
300
301 override_dh_installinit:
302- dh_installinit --no-start
303- dh_installinit --no-start -pswift-container --name=swift-container-replicator
304- dh_installinit --no-start -pswift-container --name=swift-container-auditor
305- dh_installinit --no-start -pswift-container --name=swift-container-updater
306- dh_installinit --no-start -pswift-container --name=swift-container-sync
307- dh_installinit --no-start -pswift-account --name=swift-account-replicator
308- dh_installinit --no-start -pswift-account --name=swift-account-auditor
309- dh_installinit --no-start -pswift-account --name=swift-account-reaper
310- dh_installinit --no-start -pswift-object --name=swift-object-replicator
311- dh_installinit --no-start -pswift-object --name=swift-object-auditor
312- dh_installinit --no-start -pswift-object --name=swift-object-updater
313- dh_installinit --no-start -pswift-object --name=swift-object-reconstructor
314+ set -e ; set -x ; \
315+ for FILE in $(sort $(patsubst debian/%,%,$(wildcard debian/*.init))) ; do \
316+ PKG=`echo $$FILE | cut -d. -f1` ; \
317+ NAME=`echo $$FILE | cut -d. -f2` ; \
318+ dh_installinit --error-handler=true -p$$PKG --name=$$NAME ;\
319+ done
320+
321+override_dh_installsystemd:
322+ set -e ; set -x ; \
323+ for FILE in $(sort $(patsubst debian/%,%,$(wildcard debian/*.service))) ; do \
324+ PKG=`echo $$FILE | cut -d. -f1` ; \
325+ NAME=`echo $$FILE | cut -d. -f2` ; \
326+ dh_installsystemd -p$$PKG --name=$$NAME ;\
327+ done
328
329 override_dh_compress:
330 dh_compress -Xconf-sample
331diff --git a/debian/swift-account-generator b/debian/swift-account-generator
332new file mode 100755
333index 0000000..955c6e4
334--- /dev/null
335+++ b/debian/swift-account-generator
336@@ -0,0 +1,32 @@
337+#!/bin/sh
338+
339+# This systemd generator creates dependency symlinks that make all
340+# Swift account servers be started/stopped/reloaded
341+# when swift-account*.service is started/stopped/reloaded.
342+
343+set -eu
344+
345+GENDIR="$1"
346+LIBDIR="/lib/systemd/system"
347+CONFIG=/etc/swift/account-server
348+
349+if [ ! -d "$CONFIG" ] ; then
350+ # Single config mode
351+ exit 0
352+fi
353+
354+for NAME in $CONFIG/* ; do
355+ NAME=${NAME#$CONFIG}
356+ NAME=${NAME#/}
357+ NAME=${NAME%.conf}
358+
359+ for i in account account-auditor account-reaper account-replicator ; do
360+ mkdir -p "$GENDIR/swift-$i.service.wants"
361+ ln -s \
362+ "$LIBDIR/swift-$i@.service" \
363+ "$GENDIR/swift-$i.service.wants/swift-$i@$NAME.service"
364+ done
365+done
366+
367+exit 0
368+
369diff --git a/debian/swift-account.init b/debian/swift-account.init
370deleted file mode 100644
371index 3eadb88..0000000
372--- a/debian/swift-account.init
373+++ /dev/null
374@@ -1,49 +0,0 @@
375-#! /bin/sh
376-### BEGIN INIT INFO
377-# Provides: swift-account
378-# Required-Start: $remote_fs
379-# Required-Stop: $remote_fs
380-# Default-Start: 2 3 4 5
381-# Default-Stop: 0 1 6
382-# Short-Description: Swift account server
383-# Description: Account server for swift.
384-### END INIT INFO
385-
386-SERVICE_NAME="account-server"
387-PRINT_NAME="Swift account server"
388-
389-. /lib/lsb/init-functions
390-
391-if ! [ -x /usr/bin/swift-init ] ; then
392- exit 0
393-fi
394-
395-if ! [ -f "/etc/swift/account-server.conf" ] ; then
396- exit 6
397-fi
398-
399-case "$1" in
400-start)
401- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
402- /usr/bin/swift-init ${SERVICE_NAME} start
403- log_end_msg $?
404-;;
405-stop)
406- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
407- /usr/bin/swift-init ${SERVICE_NAME} stop
408- log_end_msg $?
409-;;
410-restart|force-reload|reload)
411- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
412- /usr/bin/swift-init ${SERVICE_NAME} reload
413-;;
414-status)
415- exec /usr/bin/swift-init ${SERVICE_NAME} status
416-;;
417-*)
418- echo "Usage: $0 {start|stop|restart|reload}"
419- exit 1
420-;;
421-esac
422-
423-exit 0
424diff --git a/debian/swift-account.install b/debian/swift-account.install
425index 576f829..2e6419a 100644
426--- a/debian/swift-account.install
427+++ b/debian/swift-account.install
428@@ -1,3 +1,6 @@
429+#! /usr/bin/dh-exec --with=install
430+debian/swift-account-generator /lib/systemd/system-generators
431+
432 usr/bin/swift-account-audit
433 usr/bin/swift-account-auditor
434 usr/bin/swift-account-info
435diff --git a/debian/swift-account.swift-account-auditor.init b/debian/swift-account.swift-account-auditor.init
436deleted file mode 100644
437index 2cb92b4..0000000
438--- a/debian/swift-account.swift-account-auditor.init
439+++ /dev/null
440@@ -1,49 +0,0 @@
441-#! /bin/sh
442-### BEGIN INIT INFO
443-# Provides: swift-account-auditor
444-# Required-Start: $remote_fs
445-# Required-Stop: $remote_fs
446-# Default-Start: 2 3 4 5
447-# Default-Stop: 0 1 6
448-# Short-Description: Swift account auditor
449-# Description: Account auditor for swift.
450-### END INIT INFO
451-
452-SERVICE_NAME="account-auditor"
453-PRINT_NAME="Swift account auditor"
454-
455-. /lib/lsb/init-functions
456-
457-if ! [ -x /usr/bin/swift-init ] ; then
458- exit 0
459-fi
460-
461-if ! [ -f "/etc/swift/account-server.conf" ] ; then
462- exit 6
463-fi
464-
465-case "$1" in
466-start)
467- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
468- /usr/bin/swift-init ${SERVICE_NAME} start
469- log_end_msg $?
470-;;
471-stop)
472- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
473- /usr/bin/swift-init ${SERVICE_NAME} stop
474- log_end_msg $?
475-;;
476-restart|force-reload|reload)
477- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
478- /usr/bin/swift-init ${SERVICE_NAME} reload
479-;;
480-status)
481- exec /usr/bin/swift-init ${SERVICE_NAME} status
482-;;
483-*)
484- echo "Usage: $0 {start|stop|restart|reload}"
485- exit 1
486-;;
487-esac
488-
489-exit 0
490diff --git a/debian/swift-account.swift-account-auditor.init.in b/debian/swift-account.swift-account-auditor.init.in
491new file mode 100644
492index 0000000..8289a92
493--- /dev/null
494+++ b/debian/swift-account.swift-account-auditor.init.in
495@@ -0,0 +1,17 @@
496+#! /bin/sh
497+### BEGIN INIT INFO
498+# Provides: swift-account-auditor
499+# Required-Start: $remote_fs
500+# Required-Stop: $remote_fs
501+# Default-Start: 2 3 4 5
502+# Default-Stop: 0 1 6
503+# Short-Description: Swift account auditor
504+# Description: Account auditor server for Swift.
505+### END INIT INFO
506+
507+PROJECT_NAME=swift
508+NAME="${PROJECT_NAME}-account-auditor"
509+DESC="OpenStack Swift account auditor"
510+CONFIG=account-server
511+MULTI=1
512+SYSTEMD_DOC="man:${NAME}(1)"
513diff --git a/debian/swift-account.swift-account-auditor.upstart b/debian/swift-account.swift-account-auditor.upstart
514deleted file mode 100644
515index d490395..0000000
516--- a/debian/swift-account.swift-account-auditor.upstart
517+++ /dev/null
518@@ -1,20 +0,0 @@
519-# swift-account-auditor - SWIFT Account Auditor
520-#
521-# The swift account auditor.
522-
523-description "SWIFT Account Auditor"
524-author "Marc Cluet <marc.cluet@ubuntu.com>"
525-
526-start on runlevel [2345]
527-stop on runlevel [016]
528-
529-pre-start script
530- if [ -f "/etc/swift/account-server.conf" ]; then
531- exec /usr/bin/swift-init account-auditor start
532- else
533- exit 1
534- fi
535-end script
536-
537-post-stop exec /usr/bin/swift-init account-auditor stop
538-
539diff --git a/debian/swift-account.swift-account-reaper.init b/debian/swift-account.swift-account-reaper.init
540deleted file mode 100644
541index 4e39ab0..0000000
542--- a/debian/swift-account.swift-account-reaper.init
543+++ /dev/null
544@@ -1,49 +0,0 @@
545-#! /bin/sh
546-### BEGIN INIT INFO
547-# Provides: swift-account-reaper
548-# Required-Start: $remote_fs
549-# Required-Stop: $remote_fs
550-# Default-Start: 2 3 4 5
551-# Default-Stop: 0 1 6
552-# Short-Description: Swift account reaper
553-# Description: Account reaper for swift.
554-### END INIT INFO
555-
556-SERVICE_NAME="account-reaper"
557-PRINT_NAME="Swift account reaper"
558-
559-. /lib/lsb/init-functions
560-
561-if ! [ -x /usr/bin/swift-init ] ; then
562- exit 0
563-fi
564-
565-if ! [ -f "/etc/swift/account-server.conf" ] ; then
566- exit 6
567-fi
568-
569-case "$1" in
570-start)
571- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
572- /usr/bin/swift-init ${SERVICE_NAME} start
573- log_end_msg $?
574-;;
575-stop)
576- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
577- /usr/bin/swift-init ${SERVICE_NAME} stop
578- log_end_msg $?
579-;;
580-restart|force-reload|reload)
581- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
582- /usr/bin/swift-init ${SERVICE_NAME} reload
583-;;
584-status)
585- exec /usr/bin/swift-init ${SERVICE_NAME} status
586-;;
587-*)
588- echo "Usage: $0 {start|stop|restart|reload}"
589- exit 1
590-;;
591-esac
592-
593-exit 0
594diff --git a/debian/swift-account.swift-account-reaper.init.in b/debian/swift-account.swift-account-reaper.init.in
595new file mode 100644
596index 0000000..ee73f62
597--- /dev/null
598+++ b/debian/swift-account.swift-account-reaper.init.in
599@@ -0,0 +1,17 @@
600+#! /bin/sh
601+### BEGIN INIT INFO
602+# Provides: swift-account-reaper
603+# Required-Start: $remote_fs
604+# Required-Stop: $remote_fs
605+# Default-Start: 2 3 4 5
606+# Default-Stop: 0 1 6
607+# Short-Description: Swift account reaper
608+# Description: Account reaper for Swift.
609+### END INIT INFO
610+
611+PROJECT_NAME=swift
612+NAME="${PROJECT_NAME}-account-reaper"
613+DESC="OpenStack Swift account reaper"
614+CONFIG=account-server
615+MULTI=1
616+SYSTEMD_DOC="man:${NAME}(1)"
617diff --git a/debian/swift-account.swift-account-reaper.upstart b/debian/swift-account.swift-account-reaper.upstart
618deleted file mode 100644
619index a86ff6f..0000000
620--- a/debian/swift-account.swift-account-reaper.upstart
621+++ /dev/null
622@@ -1,20 +0,0 @@
623-# swift-account-reaper - SWIFT Account Reaper
624-#
625-# The swift account reaper.
626-
627-description "SWIFT Account Reaper"
628-author "Marc Cluet <marc.cluet@ubuntu.com>"
629-
630-start on runlevel [2345]
631-stop on runlevel [016]
632-
633-pre-start script
634- if [ -f "/etc/swift/account-server.conf" ]; then
635- exec /usr/bin/swift-init account-reaper start
636- else
637- exit 1
638- fi
639-end script
640-
641-post-stop exec /usr/bin/swift-init account-reaper stop
642-
643diff --git a/debian/swift-account.swift-account-replicator.init b/debian/swift-account.swift-account-replicator.init
644deleted file mode 100644
645index 2effcba..0000000
646--- a/debian/swift-account.swift-account-replicator.init
647+++ /dev/null
648@@ -1,49 +0,0 @@
649-#! /bin/sh
650-### BEGIN INIT INFO
651-# Provides: swift-account-replicator
652-# Required-Start: $remote_fs
653-# Required-Stop: $remote_fs
654-# Default-Start: 2 3 4 5
655-# Default-Stop: 0 1 6
656-# Short-Description: Swift account replicator
657-# Description: Account replicator for swift.
658-### END INIT INFO
659-
660-SERVICE_NAME="account-replicator"
661-PRINT_NAME="Swift account replicator"
662-
663-. /lib/lsb/init-functions
664-
665-if ! [ -x /usr/bin/swift-init ] ; then
666- exit 0
667-fi
668-
669-if ! [ -f "/etc/swift/account-server.conf" ] ; then
670- exit 6
671-fi
672-
673-case "$1" in
674-start)
675- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
676- /usr/bin/swift-init ${SERVICE_NAME} start
677- log_end_msg $?
678-;;
679-stop)
680- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
681- /usr/bin/swift-init ${SERVICE_NAME} stop
682- log_end_msg $?
683-;;
684-restart|force-reload|reload)
685- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
686- /usr/bin/swift-init ${SERVICE_NAME} reload
687-;;
688-status)
689- exec /usr/bin/swift-init ${SERVICE_NAME} status
690-;;
691-*)
692- echo "Usage: $0 {start|stop|restart|reload}"
693- exit 1
694-;;
695-esac
696-
697-exit 0
698diff --git a/debian/swift-account.swift-account-replicator.init.in b/debian/swift-account.swift-account-replicator.init.in
699new file mode 100644
700index 0000000..d590827
701--- /dev/null
702+++ b/debian/swift-account.swift-account-replicator.init.in
703@@ -0,0 +1,17 @@
704+#! /bin/sh
705+### BEGIN INIT INFO
706+# Provides: swift-account-replicator
707+# Required-Start: $remote_fs
708+# Required-Stop: $remote_fs
709+# Default-Start: 2 3 4 5
710+# Default-Stop: 0 1 6
711+# Short-Description: Swift account replicator
712+# Description: Account replicator for Swift.
713+### END INIT INFO
714+
715+PROJECT_NAME=swift
716+NAME="${PROJECT_NAME}-account-replicator"
717+DESC="OpenStack Swift account replicator"
718+CONFIG=account-server
719+MULTI=1
720+SYSTEMD_DOC="man:${NAME}(1)"
721diff --git a/debian/swift-account.swift-account-replicator.upstart b/debian/swift-account.swift-account-replicator.upstart
722deleted file mode 100644
723index 874da6e..0000000
724--- a/debian/swift-account.swift-account-replicator.upstart
725+++ /dev/null
726@@ -1,20 +0,0 @@
727-# swift-account-replicator - SWIFT Account Replicator
728-#
729-# The swift account replicator.
730-
731-description "SWIFT Account Replicator"
732-author "Marc Cluet <marc.cluet@ubuntu.com>"
733-
734-start on runlevel [2345]
735-stop on runlevel [016]
736-
737-pre-start script
738- if [ -f "/etc/swift/account-server.conf" ]; then
739- exec /usr/bin/swift-init account-replicator start
740- else
741- exit 1
742- fi
743-end script
744-
745-post-stop exec /usr/bin/swift-init account-replicator stop
746-
747diff --git a/debian/swift-account.swift-account.init.in b/debian/swift-account.swift-account.init.in
748new file mode 100644
749index 0000000..3f53057
750--- /dev/null
751+++ b/debian/swift-account.swift-account.init.in
752@@ -0,0 +1,17 @@
753+#! /bin/sh
754+### BEGIN INIT INFO
755+# Provides: swift-account
756+# Required-Start: $remote_fs
757+# Required-Stop: $remote_fs
758+# Default-Start: 2 3 4 5
759+# Default-Stop: 0 1 6
760+# Short-Description: Swift account server
761+# Description: Account server for Swift.
762+### END INIT INFO
763+
764+PROJECT_NAME=swift
765+NAME="${PROJECT_NAME}-account-server"
766+DESC="OpenStack Swift account server"
767+CONFIG=account-server
768+MULTI=1
769+SYSTEMD_DOC="man:${NAME}(1)"
770diff --git a/debian/swift-account.upstart b/debian/swift-account.upstart
771deleted file mode 100644
772index f1d15f2..0000000
773--- a/debian/swift-account.upstart
774+++ /dev/null
775@@ -1,20 +0,0 @@
776-# swift-account-server - SWIFT Account Server
777-#
778-# The swift account server.
779-
780-description "SWIFT Account Server"
781-author "Marc Cluet <marc.cluet@ubuntu.com>"
782-
783-start on runlevel [2345]
784-stop on runlevel [016]
785-
786-pre-start script
787- if [ -f "/etc/swift/account-server.conf" ]; then
788- exec /usr/bin/swift-init account-server start
789- else
790- exit 1
791- fi
792-end script
793-
794-post-stop exec /usr/bin/swift-init account-server stop
795-
796diff --git a/debian/swift-container-generator b/debian/swift-container-generator
797new file mode 100755
798index 0000000..51e9515
799--- /dev/null
800+++ b/debian/swift-container-generator
801@@ -0,0 +1,32 @@
802+#!/bin/sh
803+
804+# This systemd generator creates dependency symlinks that make all
805+# Swift account servers be started/stopped/reloaded
806+# when swift-account*.service is started/stopped/reloaded.
807+
808+set -eu
809+
810+GENDIR="$1"
811+LIBDIR="/lib/systemd/system"
812+CONFIG=/etc/swift/account-server
813+
814+if [ ! -d "$CONFIG" ] ; then
815+ # Single config mode
816+ exit 0
817+fi
818+
819+for NAME in $CONFIG/* ; do
820+ NAME=${NAME#$CONFIG}
821+ NAME=${NAME#/}
822+ NAME=${NAME%.conf}
823+
824+ for i in container container-auditor container-replicator container-sharder container-sync container-updater ; do
825+ mkdir -p "$GENDIR/swift-$i.service.wants"
826+ ln -s \
827+ "$LIBDIR/swift-$i@.service" \
828+ "$GENDIR/swift-$i.service.wants/swift-$i@$NAME.service"
829+ done
830+done
831+
832+exit 0
833+
834diff --git a/debian/swift-container.init b/debian/swift-container.init
835deleted file mode 100644
836index a320afc..0000000
837--- a/debian/swift-container.init
838+++ /dev/null
839@@ -1,49 +0,0 @@
840-#! /bin/sh
841-### BEGIN INIT INFO
842-# Provides: swift-container
843-# Required-Start: $remote_fs
844-# Required-Stop: $remote_fs
845-# Default-Start: 2 3 4 5
846-# Default-Stop: 0 1 6
847-# Short-Description: Swift container server
848-# Description: Container server for swift.
849-### END INIT INFO
850-
851-SERVICE_NAME="container-server"
852-PRINT_NAME="Swift container server"
853-
854-. /lib/lsb/init-functions
855-
856-if ! [ -x /usr/bin/swift-init ] ; then
857- exit 0
858-fi
859-
860-if ! [ -f "/etc/swift/container-server.conf" ] ; then
861- exit 6
862-fi
863-
864-case "$1" in
865-start)
866- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
867- /usr/bin/swift-init ${SERVICE_NAME} start
868- log_end_msg $?
869-;;
870-stop)
871- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
872- /usr/bin/swift-init ${SERVICE_NAME} stop
873- log_end_msg $?
874-;;
875-restart|force-reload|reload)
876- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
877- /usr/bin/swift-init ${SERVICE_NAME} reload
878-;;
879-status)
880- exec /usr/bin/swift-init ${SERVICE_NAME} status
881-;;
882-*)
883- echo "Usage: $0 {start|stop|restart|reload}"
884- exit 1
885-;;
886-esac
887-
888-exit 0
889diff --git a/debian/swift-container.install b/debian/swift-container.install
890index 96f5112..f70a026 100644
891--- a/debian/swift-container.install
892+++ b/debian/swift-container.install
893@@ -1,3 +1,6 @@
894+#! /usr/bin/dh-exec --with=install
895+debian/swift-container-generator /lib/systemd/system-generators
896+
897 usr/bin/swift-container-*
898 usr/bin/swift-manage-shard-ranges
899 usr/bin/swift-reconciler-enqueue
900diff --git a/debian/swift-container.swift-container-auditor.init b/debian/swift-container.swift-container-auditor.init
901deleted file mode 100644
902index b81f3fb..0000000
903--- a/debian/swift-container.swift-container-auditor.init
904+++ /dev/null
905@@ -1,49 +0,0 @@
906-#! /bin/sh
907-### BEGIN INIT INFO
908-# Provides: swift-container-auditor
909-# Required-Start: $remote_fs
910-# Required-Stop: $remote_fs
911-# Default-Start: 2 3 4 5
912-# Default-Stop: 0 1 6
913-# Short-Description: Swift container auditor
914-# Description: Container auditor for swift.
915-### END INIT INFO
916-
917-SERVICE_NAME="container-auditor"
918-PRINT_NAME="Swift container auditor"
919-
920-. /lib/lsb/init-functions
921-
922-if ! [ -x /usr/bin/swift-init ] ; then
923- exit 0
924-fi
925-
926-if ! [ -f "/etc/swift/container-server.conf" ] ; then
927- exit 6
928-fi
929-
930-case "$1" in
931-start)
932- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
933- /usr/bin/swift-init ${SERVICE_NAME} start
934- log_end_msg $?
935-;;
936-stop)
937- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
938- /usr/bin/swift-init ${SERVICE_NAME} stop
939- log_end_msg $?
940-;;
941-restart|force-reload|reload)
942- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
943- /usr/bin/swift-init ${SERVICE_NAME} reload
944-;;
945-status)
946- exec /usr/bin/swift-init ${SERVICE_NAME} status
947-;;
948-*)
949- echo "Usage: $0 {start|stop|restart|reload}"
950- exit 1
951-;;
952-esac
953-
954-exit 0
955diff --git a/debian/swift-container.swift-container-auditor.init.in b/debian/swift-container.swift-container-auditor.init.in
956new file mode 100644
957index 0000000..ce7c48f
958--- /dev/null
959+++ b/debian/swift-container.swift-container-auditor.init.in
960@@ -0,0 +1,17 @@
961+#! /bin/sh
962+### BEGIN INIT INFO
963+# Provides: swift-container-auditor
964+# Required-Start: $remote_fs
965+# Required-Stop: $remote_fs
966+# Default-Start: 2 3 4 5
967+# Default-Stop: 0 1 6
968+# Short-Description: Swift container auditor
969+# Description: Container auditor server for Swift.
970+### END INIT INFO
971+
972+PROJECT_NAME=swift
973+NAME="${PROJECT_NAME}-container-auditor"
974+DESC="OpenStack Swift container auditor"
975+CONFIG=container-server
976+MULTI=1
977+SYSTEMD_DOC="man:${NAME}(1)"
978diff --git a/debian/swift-container.swift-container-auditor.upstart b/debian/swift-container.swift-container-auditor.upstart
979deleted file mode 100644
980index 091df78..0000000
981--- a/debian/swift-container.swift-container-auditor.upstart
982+++ /dev/null
983@@ -1,20 +0,0 @@
984-# swift-container-auditor - SWIFT Container Auditor
985-#
986-# The swift container auditor.
987-
988-description "SWIFT Container Auditor"
989-author "Marc Cluet <marc.cluet@ubuntu.com>"
990-
991-start on runlevel [2345]
992-stop on runlevel [016]
993-
994-pre-start script
995- if [ -f "/etc/swift/container-server.conf" ]; then
996- exec /usr/bin/swift-init container-auditor start
997- else
998- exit 1
999- fi
1000-end script
1001-
1002-post-stop exec /usr/bin/swift-init container-auditor stop
1003-
1004diff --git a/debian/swift-container.swift-container-reconciler.init.in b/debian/swift-container.swift-container-reconciler.init.in
1005new file mode 100644
1006index 0000000..d566089
1007--- /dev/null
1008+++ b/debian/swift-container.swift-container-reconciler.init.in
1009@@ -0,0 +1,16 @@
1010+#! /bin/sh
1011+### BEGIN INIT INFO
1012+# Provides: swift-container-reconciler
1013+# Required-Start: $remote_fs
1014+# Required-Stop: $remote_fs
1015+# Default-Start: 2 3 4 5
1016+# Default-Stop: 0 1 6
1017+# Short-Description: Swift container reconciler
1018+# Description: Container reconciler for Swift.
1019+### END INIT INFO
1020+
1021+PROJECT_NAME=swift
1022+NAME="${PROJECT_NAME}-container-reconciler"
1023+DESC="OpenStack Swift container reconciler"
1024+CONFIG=container-reconciler
1025+SYSTEMD_DOC="man:${NAME}(1)"
1026diff --git a/debian/swift-container.swift-container-replicator.init b/debian/swift-container.swift-container-replicator.init
1027deleted file mode 100644
1028index 5a906e5..0000000
1029--- a/debian/swift-container.swift-container-replicator.init
1030+++ /dev/null
1031@@ -1,49 +0,0 @@
1032-#! /bin/sh
1033-### BEGIN INIT INFO
1034-# Provides: swift-container-replicator
1035-# Required-Start: $remote_fs
1036-# Required-Stop: $remote_fs
1037-# Default-Start: 2 3 4 5
1038-# Default-Stop: 0 1 6
1039-# Short-Description: Swift container replicator
1040-# Description: Container replicator for swift.
1041-### END INIT INFO
1042-
1043-SERVICE_NAME="container-replicator"
1044-PRINT_NAME="Swift container replicator"
1045-
1046-. /lib/lsb/init-functions
1047-
1048-if ! [ -x /usr/bin/swift-init ] ; then
1049- exit 0
1050-fi
1051-
1052-if ! [ -f "/etc/swift/container-server.conf" ] ; then
1053- exit 6
1054-fi
1055-
1056-case "$1" in
1057-start)
1058- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1059- /usr/bin/swift-init ${SERVICE_NAME} start
1060- log_end_msg $?
1061-;;
1062-stop)
1063- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1064- /usr/bin/swift-init ${SERVICE_NAME} stop
1065- log_end_msg $?
1066-;;
1067-restart|force-reload|reload)
1068- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1069- /usr/bin/swift-init ${SERVICE_NAME} reload
1070-;;
1071-status)
1072- exec /usr/bin/swift-init ${SERVICE_NAME} status
1073-;;
1074-*)
1075- echo "Usage: $0 {start|stop|restart|reload}"
1076- exit 1
1077-;;
1078-esac
1079-
1080-exit 0
1081diff --git a/debian/swift-container.swift-container-replicator.init.in b/debian/swift-container.swift-container-replicator.init.in
1082new file mode 100644
1083index 0000000..4b989d5
1084--- /dev/null
1085+++ b/debian/swift-container.swift-container-replicator.init.in
1086@@ -0,0 +1,17 @@
1087+#! /bin/sh
1088+### BEGIN INIT INFO
1089+# Provides: swift-container-replicator
1090+# Required-Start: $remote_fs
1091+# Required-Stop: $remote_fs
1092+# Default-Start: 2 3 4 5
1093+# Default-Stop: 0 1 6
1094+# Short-Description: Swift container replicator
1095+# Description: Container replicator for Swift.
1096+### END INIT INFO
1097+
1098+PROJECT_NAME=swift
1099+NAME="${PROJECT_NAME}-container-replicator"
1100+DESC="OpenStack Swift container replicator"
1101+CONFIG=container-server
1102+MULTI=1
1103+SYSTEMD_DOC="man:${NAME}(1)"
1104diff --git a/debian/swift-container.swift-container-replicator.upstart b/debian/swift-container.swift-container-replicator.upstart
1105deleted file mode 100644
1106index 0583c94..0000000
1107--- a/debian/swift-container.swift-container-replicator.upstart
1108+++ /dev/null
1109@@ -1,20 +0,0 @@
1110-# swift-container-replicator - SWIFT Container Replicator
1111-#
1112-# The swift container replicator.
1113-
1114-description "SWIFT Container Replicator"
1115-author "Marc Cluet <marc.cluet@ubuntu.com>"
1116-
1117-start on runlevel [2345]
1118-stop on runlevel [016]
1119-
1120-pre-start script
1121- if [ -f "/etc/swift/container-server.conf" ]; then
1122- exec /usr/bin/swift-init container-replicator start
1123- else
1124- exit 1
1125- fi
1126-end script
1127-
1128-post-stop exec /usr/bin/swift-init container-replicator stop
1129-
1130diff --git a/debian/swift-container.swift-container-sharder.init b/debian/swift-container.swift-container-sharder.init
1131deleted file mode 100644
1132index 232258f..0000000
1133--- a/debian/swift-container.swift-container-sharder.init
1134+++ /dev/null
1135@@ -1,49 +0,0 @@
1136-#! /bin/sh
1137-### BEGIN INIT INFO
1138-# Provides: swift-container-sharder
1139-# Required-Start: $remote_fs
1140-# Required-Stop: $remote_fs
1141-# Default-Start: 2 3 4 5
1142-# Default-Stop: 0 1 6
1143-# Short-Description: Swift container sharder
1144-# Description: Container sharder for swift.
1145-### END INIT INFO
1146-
1147-SERVICE_NAME="container-sharder"
1148-PRINT_NAME="Swift container sharder"
1149-
1150-. /lib/lsb/init-functions
1151-
1152-if ! [ -x /usr/bin/swift-init ] ; then
1153- exit 0
1154-fi
1155-
1156-if ! [ -f "/etc/swift/container-server.conf" ] ; then
1157- exit 6
1158-fi
1159-
1160-case "$1" in
1161-start)
1162- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1163- /usr/bin/swift-init ${SERVICE_NAME} start
1164- log_end_msg $?
1165-;;
1166-stop)
1167- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1168- /usr/bin/swift-init ${SERVICE_NAME} stop
1169- log_end_msg $?
1170-;;
1171-restart|force-reload|reload)
1172- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1173- /usr/bin/swift-init ${SERVICE_NAME} reload
1174-;;
1175-status)
1176- exec /usr/bin/swift-init ${SERVICE_NAME} status
1177-;;
1178-*)
1179- echo "Usage: $0 {start|stop|restart|reload}"
1180- exit 1
1181-;;
1182-esac
1183-
1184-exit 0
1185diff --git a/debian/swift-container.swift-container-sharder.init.in b/debian/swift-container.swift-container-sharder.init.in
1186new file mode 100644
1187index 0000000..9ea0e04
1188--- /dev/null
1189+++ b/debian/swift-container.swift-container-sharder.init.in
1190@@ -0,0 +1,17 @@
1191+#! /bin/sh
1192+### BEGIN INIT INFO
1193+# Provides: swift-container-sharder
1194+# Required-Start: $remote_fs
1195+# Required-Stop: $remote_fs
1196+# Default-Start: 2 3 4 5
1197+# Default-Stop: 0 1 6
1198+# Short-Description: Swift container sharder
1199+# Description: Container sharder for Swift.
1200+### END INIT INFO
1201+
1202+PROJECT_NAME=swift
1203+NAME="${PROJECT_NAME}-container-sharder"
1204+DESC="OpenStack Swift container sharder"
1205+CONFIG=container-server
1206+MULTI=1
1207+SYSTEMD_DOC="man:${NAME}(1)"
1208diff --git a/debian/swift-container.swift-container-sync.init b/debian/swift-container.swift-container-sync.init
1209deleted file mode 100644
1210index 098706a..0000000
1211--- a/debian/swift-container.swift-container-sync.init
1212+++ /dev/null
1213@@ -1,49 +0,0 @@
1214-#! /bin/sh
1215-### BEGIN INIT INFO
1216-# Provides: swift-container-sync
1217-# Required-Start: $remote_fs
1218-# Required-Stop: $remote_fs
1219-# Default-Start: 2 3 4 5
1220-# Default-Stop: 0 1 6
1221-# Short-Description: Swift container sync
1222-# Description: Container sync for swift.
1223-### END INIT INFO
1224-
1225-SERVICE_NAME="container-sync"
1226-PRINT_NAME="Swift container sync"
1227-
1228-. /lib/lsb/init-functions
1229-
1230-if ! [ -x /usr/bin/swift-init ] ; then
1231- exit 0
1232-fi
1233-
1234-if ! [ -f "/etc/swift/container-server.conf" ] ; then
1235- exit 6
1236-fi
1237-
1238-case "$1" in
1239-start)
1240- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1241- /usr/bin/swift-init ${SERVICE_NAME} start
1242- log_end_msg $?
1243-;;
1244-stop)
1245- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1246- /usr/bin/swift-init ${SERVICE_NAME} stop
1247- log_end_msg $?
1248-;;
1249-restart|force-reload|reload)
1250- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1251- /usr/bin/swift-init ${SERVICE_NAME} reload
1252-;;
1253-status)
1254- exec /usr/bin/swift-init ${SERVICE_NAME} status
1255-;;
1256-*)
1257- echo "Usage: $0 {start|stop|restart|reload}"
1258- exit 1
1259-;;
1260-esac
1261-
1262-exit 0
1263diff --git a/debian/swift-container.swift-container-sync.init.in b/debian/swift-container.swift-container-sync.init.in
1264new file mode 100644
1265index 0000000..c24e790
1266--- /dev/null
1267+++ b/debian/swift-container.swift-container-sync.init.in
1268@@ -0,0 +1,17 @@
1269+#! /bin/sh
1270+### BEGIN INIT INFO
1271+# Provides: swift-container-sync
1272+# Required-Start: $remote_fs
1273+# Required-Stop: $remote_fs
1274+# Default-Start: 2 3 4 5
1275+# Default-Stop: 0 1 6
1276+# Short-Description: Swift container sync
1277+# Description: Container sync server for Swift.
1278+### END INIT INFO
1279+
1280+PROJECT_NAME=swift
1281+NAME="${PROJECT_NAME}-container-sync"
1282+DESC="OpenStack Swift container sync"
1283+CONFIG=container-server
1284+MULTI=1
1285+SYSTEMD_DOC="man:${NAME}(1)"
1286diff --git a/debian/swift-container.swift-container-sync.upstart b/debian/swift-container.swift-container-sync.upstart
1287deleted file mode 100644
1288index 6a5c320..0000000
1289--- a/debian/swift-container.swift-container-sync.upstart
1290+++ /dev/null
1291@@ -1,15 +0,0 @@
1292-description "SWIFT Container Sync"
1293-author "James Page <james.page@ubuntu.com>"
1294-
1295-start on runlevel [2345]
1296-stop on runlevel [016]
1297-
1298-pre-start script
1299- if [ -f "/etc/swift/container-server.conf" ]; then
1300- exec /usr/bin/swift-init container-sync start
1301- else
1302- exit 1
1303- fi
1304-end script
1305-
1306-post-stop exec /usr/bin/swift-init container-sync stop
1307diff --git a/debian/swift-container.swift-container-updater.init b/debian/swift-container.swift-container-updater.init
1308deleted file mode 100644
1309index 7082e8f..0000000
1310--- a/debian/swift-container.swift-container-updater.init
1311+++ /dev/null
1312@@ -1,49 +0,0 @@
1313-#! /bin/sh
1314-### BEGIN INIT INFO
1315-# Provides: swift-container-updater
1316-# Required-Start: $remote_fs
1317-# Required-Stop: $remote_fs
1318-# Default-Start: 2 3 4 5
1319-# Default-Stop: 0 1 6
1320-# Short-Description: Swift container updater
1321-# Description: Container updater for swift.
1322-### END INIT INFO
1323-
1324-SERVICE_NAME="container-updater"
1325-PRINT_NAME="Swift container updater"
1326-
1327-. /lib/lsb/init-functions
1328-
1329-if ! [ -x /usr/bin/swift-init ] ; then
1330- exit 0
1331-fi
1332-
1333-if ! [ -f "/etc/swift/container-server.conf" ] ; then
1334- exit 6
1335-fi
1336-
1337-case "$1" in
1338-start)
1339- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1340- /usr/bin/swift-init ${SERVICE_NAME} start
1341- log_end_msg $?
1342-;;
1343-stop)
1344- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1345- /usr/bin/swift-init ${SERVICE_NAME} stop
1346- log_end_msg $?
1347-;;
1348-restart|force-reload|reload)
1349- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1350- /usr/bin/swift-init ${SERVICE_NAME} reload
1351-;;
1352-status)
1353- exec /usr/bin/swift-init ${SERVICE_NAME} status
1354-;;
1355-*)
1356- echo "Usage: $0 {start|stop|restart|reload}"
1357- exit 1
1358-;;
1359-esac
1360-
1361-exit 0
1362diff --git a/debian/swift-container.swift-container-updater.init.in b/debian/swift-container.swift-container-updater.init.in
1363new file mode 100644
1364index 0000000..73c5f36
1365--- /dev/null
1366+++ b/debian/swift-container.swift-container-updater.init.in
1367@@ -0,0 +1,17 @@
1368+#! /bin/sh
1369+### BEGIN INIT INFO
1370+# Provides: swift-container-updater
1371+# Required-Start: $remote_fs
1372+# Required-Stop: $remote_fs
1373+# Default-Start: 2 3 4 5
1374+# Default-Stop: 0 1 6
1375+# Short-Description: Swift container updater
1376+# Description: Container updater server for Swift.
1377+### END INIT INFO
1378+
1379+PROJECT_NAME=swift
1380+NAME="${PROJECT_NAME}-container-updater"
1381+DESC="OpenStack Swift container updater"
1382+CONFIG=container-server
1383+MULTI=1
1384+SYSTEMD_DOC="man:${NAME}(1)"
1385diff --git a/debian/swift-container.swift-container-updater.upstart b/debian/swift-container.swift-container-updater.upstart
1386deleted file mode 100644
1387index f41895b..0000000
1388--- a/debian/swift-container.swift-container-updater.upstart
1389+++ /dev/null
1390@@ -1,20 +0,0 @@
1391-# swift-container-updater - SWIFT Container Updater
1392-#
1393-# The swift container updater.
1394-
1395-description "SWIFT Container Updater"
1396-author "Marc Cluet <marc.cluet@ubuntu.com>"
1397-
1398-start on runlevel [2345]
1399-stop on runlevel [016]
1400-
1401-pre-start script
1402- if [ -f "/etc/swift/container-server.conf" ]; then
1403- exec /usr/bin/swift-init container-updater start
1404- else
1405- exit 1
1406- fi
1407-end script
1408-
1409-post-stop exec /usr/bin/swift-init container-updater stop
1410-
1411diff --git a/debian/swift-container.swift-container.init.in b/debian/swift-container.swift-container.init.in
1412new file mode 100644
1413index 0000000..a12c3df
1414--- /dev/null
1415+++ b/debian/swift-container.swift-container.init.in
1416@@ -0,0 +1,17 @@
1417+#! /bin/sh
1418+### BEGIN INIT INFO
1419+# Provides: swift-container
1420+# Required-Start: $remote_fs
1421+# Required-Stop: $remote_fs
1422+# Default-Start: 2 3 4 5
1423+# Default-Stop: 0 1 6
1424+# Short-Description: Swift container server
1425+# Description: Container server for Swift.
1426+### END INIT INFO
1427+
1428+PROJECT_NAME=swift
1429+NAME="${PROJECT_NAME}-container-server"
1430+DESC="OpenStack Swift container server"
1431+CONFIG=container-server
1432+MULTI=1
1433+SYSTEMD_DOC="man:${NAME}(1)"
1434diff --git a/debian/swift-container.upstart b/debian/swift-container.upstart
1435deleted file mode 100644
1436index 8035002..0000000
1437--- a/debian/swift-container.upstart
1438+++ /dev/null
1439@@ -1,20 +0,0 @@
1440-# swift-container-server - SWIFT Container Server
1441-#
1442-# The swift container server.
1443-
1444-description "SWIFT Container Server"
1445-author "Marc Cluet <marc.cluet@ubuntu.com>"
1446-
1447-start on runlevel [2345]
1448-stop on runlevel [016]
1449-
1450-pre-start script
1451- if [ -f "/etc/swift/container-server.conf" ]; then
1452- exec /usr/bin/swift-init container-server start
1453- else
1454- exit 1
1455- fi
1456-end script
1457-
1458-post-stop exec /usr/bin/swift-init container-server stop
1459-
1460diff --git a/debian/swift-object-expirer.init b/debian/swift-object-expirer.init
1461deleted file mode 100644
1462index 2800190..0000000
1463--- a/debian/swift-object-expirer.init
1464+++ /dev/null
1465@@ -1,49 +0,0 @@
1466-#! /bin/sh
1467-### BEGIN INIT INFO
1468-# Provides: swift-object-expirer
1469-# Required-Start: $remote_fs
1470-# Required-Stop: $remote_fs
1471-# Default-Start: 2 3 4 5
1472-# Default-Stop: 0 1 6
1473-# Short-Description: Swift object expirer
1474-# Description: Object expirer for swift.
1475-### END INIT INFO
1476-
1477-SERVICE_NAME="object-expirer"
1478-PRINT_NAME="Swift object expirer"
1479-
1480-. /lib/lsb/init-functions
1481-
1482-if ! [ -x /usr/bin/swift-init ] ; then
1483- exit 0
1484-fi
1485-
1486-if ! [ -f "/etc/swift/object-expirer.conf" ] ; then
1487- exit 6
1488-fi
1489-
1490-case "$1" in
1491-start)
1492- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1493- /usr/bin/swift-init ${SERVICE_NAME} start
1494- log_end_msg $?
1495-;;
1496-stop)
1497- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1498- /usr/bin/swift-init ${SERVICE_NAME} stop
1499- log_end_msg $?
1500-;;
1501-restart|force-reload|reload)
1502- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1503- /usr/bin/swift-init ${SERVICE_NAME} reload
1504-;;
1505-status)
1506- exec /usr/bin/swift-init ${SERVICE_NAME} status
1507-;;
1508-*)
1509- echo "Usage: $0 {start|stop|restart|reload}"
1510- exit 1
1511-;;
1512-esac
1513-
1514-exit 0
1515diff --git a/debian/swift-object-expirer.swift-object-expirer.init.in b/debian/swift-object-expirer.swift-object-expirer.init.in
1516new file mode 100644
1517index 0000000..ead7164
1518--- /dev/null
1519+++ b/debian/swift-object-expirer.swift-object-expirer.init.in
1520@@ -0,0 +1,16 @@
1521+#! /bin/sh
1522+### BEGIN INIT INFO
1523+# Provides: swift-object-expirer
1524+# Required-Start: $remote_fs
1525+# Required-Stop: $remote_fs
1526+# Default-Start: 2 3 4 5
1527+# Default-Stop: 0 1 6
1528+# Short-Description: Swift object expirer
1529+# Description: Object expirer daemon for Swift.
1530+### END INIT INFO
1531+
1532+PROJECT_NAME=swift
1533+NAME="${PROJECT_NAME}-object-expirer"
1534+DESC="OpenStack Swift object expirer"
1535+CONFIG=object-expirer
1536+SYSTEMD_DOC="man:${NAME}(1)"
1537diff --git a/debian/swift-object-expirer.upstart b/debian/swift-object-expirer.upstart
1538deleted file mode 100644
1539index 6ac508a..0000000
1540--- a/debian/swift-object-expirer.upstart
1541+++ /dev/null
1542@@ -1,15 +0,0 @@
1543-description "SWIFT Object Expirer"
1544-author "Will Kelly <william.kelly@rackspace.com>"
1545-
1546-start on runlevel [2345]
1547-stop on runlevel [016]
1548-
1549-pre-start script
1550- if [ -f "/etc/swift/object-expirer.conf" ]; then
1551- exec /usr/bin/swift-init object-expirer start
1552- else
1553- exit 1
1554- fi
1555-end script
1556-
1557-post-stop exec /usr/bin/swift-init object-expirer stop
1558diff --git a/debian/swift-object-generator b/debian/swift-object-generator
1559new file mode 100755
1560index 0000000..91dae09
1561--- /dev/null
1562+++ b/debian/swift-object-generator
1563@@ -0,0 +1,32 @@
1564+#!/bin/sh
1565+
1566+# This systemd generator creates dependency symlinks that make all
1567+# Swift account servers be started/stopped/reloaded
1568+# when swift-account*.service is started/stopped/reloaded.
1569+
1570+set -eu
1571+
1572+GENDIR="$1"
1573+LIBDIR="/lib/systemd/system"
1574+CONFIG=/etc/swift/account-server
1575+
1576+if [ ! -d "$CONFIG" ] ; then
1577+ # Single config mode
1578+ exit 0
1579+fi
1580+
1581+for NAME in $CONFIG/* ; do
1582+ NAME=${NAME#$CONFIG}
1583+ NAME=${NAME#/}
1584+ NAME=${NAME%.conf}
1585+
1586+ for i in object object-auditor object-reconstructor object-replicator object-updater ; do
1587+ mkdir -p "$GENDIR/swift-$i.service.wants"
1588+ ln -s \
1589+ "$LIBDIR/swift-$i@.service" \
1590+ "$GENDIR/swift-$i.service.wants/swift-$i@$NAME.service"
1591+ done
1592+done
1593+
1594+exit 0
1595+
1596diff --git a/debian/swift-object.init b/debian/swift-object.init
1597deleted file mode 100644
1598index 13609a7..0000000
1599--- a/debian/swift-object.init
1600+++ /dev/null
1601@@ -1,49 +0,0 @@
1602-#! /bin/sh
1603-### BEGIN INIT INFO
1604-# Provides: swift-object
1605-# Required-Start: $remote_fs
1606-# Required-Stop: $remote_fs
1607-# Default-Start: 2 3 4 5
1608-# Default-Stop: 0 1 6
1609-# Short-Description: Swift object server
1610-# Description: Object server for swift.
1611-### END INIT INFO
1612-
1613-SERVICE_NAME="object-server"
1614-PRINT_NAME="Swift object server"
1615-
1616-. /lib/lsb/init-functions
1617-
1618-if ! [ -x /usr/bin/swift-init ] ; then
1619- exit 0
1620-fi
1621-
1622-if ! [ -f "/etc/swift/object-server.conf" ] ; then
1623- exit 6
1624-fi
1625-
1626-case "$1" in
1627-start)
1628- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1629- /usr/bin/swift-init ${SERVICE_NAME} start
1630- log_end_msg $?
1631-;;
1632-stop)
1633- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1634- /usr/bin/swift-init ${SERVICE_NAME} stop
1635- log_end_msg $?
1636-;;
1637-restart|force-reload|reload)
1638- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1639- /usr/bin/swift-init ${SERVICE_NAME} reload
1640-;;
1641-status)
1642- exec /usr/bin/swift-init ${SERVICE_NAME} status
1643-;;
1644-*)
1645- echo "Usage: $0 {start|stop|restart|reload}"
1646- exit 1
1647-;;
1648-esac
1649-
1650-exit 0
1651diff --git a/debian/swift-object.install b/debian/swift-object.install
1652index 44a67e0..eff451b 100644
1653--- a/debian/swift-object.install
1654+++ b/debian/swift-object.install
1655@@ -1,3 +1,6 @@
1656+#! /usr/bin/dh-exec --with=install
1657+debian/swift-object-generator /lib/systemd/system-generators
1658+
1659 usr/bin/swift-object-auditor
1660 usr/bin/swift-object-info
1661 usr/bin/swift-object-reconstructor
1662diff --git a/debian/swift-object.swift-object-auditor.init b/debian/swift-object.swift-object-auditor.init
1663deleted file mode 100644
1664index 0a92df5..0000000
1665--- a/debian/swift-object.swift-object-auditor.init
1666+++ /dev/null
1667@@ -1,49 +0,0 @@
1668-#! /bin/sh
1669-### BEGIN INIT INFO
1670-# Provides: swift-object-auditor
1671-# Required-Start: $remote_fs
1672-# Required-Stop: $remote_fs
1673-# Default-Start: 2 3 4 5
1674-# Default-Stop: 0 1 6
1675-# Short-Description: Swift object auditor
1676-# Description: Object auditor for swift.
1677-### END INIT INFO
1678-
1679-SERVICE_NAME="object-auditor"
1680-PRINT_NAME="Swift object auditor"
1681-
1682-. /lib/lsb/init-functions
1683-
1684-if ! [ -x /usr/bin/swift-init ] ; then
1685- exit 0
1686-fi
1687-
1688-if ! [ -f "/etc/swift/object-server.conf" ] ; then
1689- exit 6
1690-fi
1691-
1692-case "$1" in
1693-start)
1694- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1695- /usr/bin/swift-init ${SERVICE_NAME} start
1696- log_end_msg $?
1697-;;
1698-stop)
1699- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1700- /usr/bin/swift-init ${SERVICE_NAME} stop
1701- log_end_msg $?
1702-;;
1703-restart|force-reload|reload)
1704- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1705- /usr/bin/swift-init ${SERVICE_NAME} reload
1706-;;
1707-status)
1708- exec /usr/bin/swift-init ${SERVICE_NAME} status
1709-;;
1710-*)
1711- echo "Usage: $0 {start|stop|restart|reload}"
1712- exit 1
1713-;;
1714-esac
1715-
1716-exit 0
1717diff --git a/debian/swift-object.swift-object-auditor.init.in b/debian/swift-object.swift-object-auditor.init.in
1718new file mode 100644
1719index 0000000..53b0ce5
1720--- /dev/null
1721+++ b/debian/swift-object.swift-object-auditor.init.in
1722@@ -0,0 +1,17 @@
1723+#! /bin/sh
1724+### BEGIN INIT INFO
1725+# Provides: swift-object-auditor
1726+# Required-Start: $remote_fs
1727+# Required-Stop: $remote_fs
1728+# Default-Start: 2 3 4 5
1729+# Default-Stop: 0 1 6
1730+# Short-Description: Swift object auditor
1731+# Description: Object auditor server for Swift.
1732+### END INIT INFO
1733+
1734+PROJECT_NAME=swift
1735+NAME="${PROJECT_NAME}-object-auditor"
1736+DESC="OpenStack Swift object auditor"
1737+CONFIG=object-server
1738+MULTI=1
1739+SYSTEMD_DOC="man:${NAME}(1)"
1740diff --git a/debian/swift-object.swift-object-auditor.upstart b/debian/swift-object.swift-object-auditor.upstart
1741deleted file mode 100644
1742index af5b76d..0000000
1743--- a/debian/swift-object.swift-object-auditor.upstart
1744+++ /dev/null
1745@@ -1,20 +0,0 @@
1746-# swift-object-auditor - SWIFT Object Auditor
1747-#
1748-# The swift object auditor.
1749-
1750-description "SWIFT Object Auditor"
1751-author "Marc Cluet <marc.cluet@ubuntu.com>"
1752-
1753-start on runlevel [2345]
1754-stop on runlevel [016]
1755-
1756-pre-start script
1757- if [ -f "/etc/swift/object-server.conf" ]; then
1758- exec /usr/bin/swift-init object-auditor start
1759- else
1760- exit 1
1761- fi
1762-end script
1763-
1764-post-stop exec /usr/bin/swift-init object-auditor stop
1765-
1766diff --git a/debian/swift-object.swift-object-reconstructor.init b/debian/swift-object.swift-object-reconstructor.init
1767deleted file mode 100644
1768index 20a1b5e..0000000
1769--- a/debian/swift-object.swift-object-reconstructor.init
1770+++ /dev/null
1771@@ -1,49 +0,0 @@
1772-#! /bin/sh
1773-### BEGIN INIT INFO
1774-# Provides: swift-object-reconstructor
1775-# Required-Start: $remote_fs
1776-# Required-Stop: $remote_fs
1777-# Default-Start: 2 3 4 5
1778-# Default-Stop: 0 1 6
1779-# Short-Description: Swift object reconstructor
1780-# Description: Object reconstructor for swift.
1781-### END INIT INFO
1782-
1783-SERVICE_NAME="object-reconstructor"
1784-PRINT_NAME="Swift object reconstructor"
1785-
1786-. /lib/lsb/init-functions
1787-
1788-if ! [ -x /usr/bin/swift-init ] ; then
1789- exit 0
1790-fi
1791-
1792-if ! [ -f "/etc/swift/object-server.conf" ] ; then
1793- exit 6
1794-fi
1795-
1796-case "$1" in
1797-start)
1798- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1799- /usr/bin/swift-init ${SERVICE_NAME} start
1800- log_end_msg $?
1801-;;
1802-stop)
1803- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1804- /usr/bin/swift-init ${SERVICE_NAME} stop
1805- log_end_msg $?
1806-;;
1807-restart|force-reload|reload)
1808- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1809- /usr/bin/swift-init ${SERVICE_NAME} reload
1810-;;
1811-status)
1812- exec /usr/bin/swift-init ${SERVICE_NAME} status
1813-;;
1814-*)
1815- echo "Usage: $0 {start|stop|restart|reload}"
1816- exit 1
1817-;;
1818-esac
1819-
1820-exit 0
1821diff --git a/debian/swift-object.swift-object-reconstructor.init.in b/debian/swift-object.swift-object-reconstructor.init.in
1822new file mode 100644
1823index 0000000..6324e00
1824--- /dev/null
1825+++ b/debian/swift-object.swift-object-reconstructor.init.in
1826@@ -0,0 +1,17 @@
1827+#! /bin/sh
1828+### BEGIN INIT INFO
1829+# Provides: swift-object-reconstructor
1830+# Required-Start: $remote_fs
1831+# Required-Stop: $remote_fs
1832+# Default-Start: 2 3 4 5
1833+# Default-Stop: 0 1 6
1834+# Short-Description: Swift object reconstructor
1835+# Description: Object reconstructor server for Swift.
1836+### END INIT INFO
1837+
1838+PROJECT_NAME=swift
1839+NAME="${PROJECT_NAME}-object-reconstructor"
1840+DESC="OpenStack Swift object reconstructor"
1841+CONFIG=object-server
1842+MULTI=1
1843+SYSTEMD_DOC="man:${NAME}(1)"
1844diff --git a/debian/swift-object.swift-object-reconstructor.upstart b/debian/swift-object.swift-object-reconstructor.upstart
1845deleted file mode 100644
1846index 987f8ab..0000000
1847--- a/debian/swift-object.swift-object-reconstructor.upstart
1848+++ /dev/null
1849@@ -1,20 +0,0 @@
1850-# swift-object-reconstructor - SWIFT Object Reconstuctor
1851-#
1852-# The swift object reconstructor.
1853-
1854-description "SWIFT Object Reconstuctor"
1855-author "Marc Cluet <marc.cluet@ubuntu.com>"
1856-
1857-start on runlevel [2345]
1858-stop on runlevel [016]
1859-
1860-pre-start script
1861- if [ -f "/etc/swift/object-server.conf" ]; then
1862- exec /usr/bin/swift-init object-reconstructor start
1863- else
1864- exit 1
1865- fi
1866-end script
1867-
1868-post-stop exec /usr/bin/swift-init object-reconstructor stop
1869-
1870diff --git a/debian/swift-object.swift-object-replicator.init b/debian/swift-object.swift-object-replicator.init
1871deleted file mode 100644
1872index ec6fd50..0000000
1873--- a/debian/swift-object.swift-object-replicator.init
1874+++ /dev/null
1875@@ -1,49 +0,0 @@
1876-#! /bin/sh
1877-### BEGIN INIT INFO
1878-# Provides: swift-object-replicator
1879-# Required-Start: $remote_fs
1880-# Required-Stop: $remote_fs
1881-# Default-Start: 2 3 4 5
1882-# Default-Stop: 0 1 6
1883-# Short-Description: Swift object replicator
1884-# Description: Object replicator for swift.
1885-### END INIT INFO
1886-
1887-SERVICE_NAME="object-replicator"
1888-PRINT_NAME="Swift object replicator"
1889-
1890-. /lib/lsb/init-functions
1891-
1892-if ! [ -x /usr/bin/swift-init ] ; then
1893- exit 0
1894-fi
1895-
1896-if ! [ -f "/etc/swift/object-server.conf" ] ; then
1897- exit 6
1898-fi
1899-
1900-case "$1" in
1901-start)
1902- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1903- /usr/bin/swift-init ${SERVICE_NAME} start
1904- log_end_msg $?
1905-;;
1906-stop)
1907- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1908- /usr/bin/swift-init ${SERVICE_NAME} stop
1909- log_end_msg $?
1910-;;
1911-restart|force-reload|reload)
1912- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
1913- /usr/bin/swift-init ${SERVICE_NAME} reload
1914-;;
1915-status)
1916- exec /usr/bin/swift-init ${SERVICE_NAME} status
1917-;;
1918-*)
1919- echo "Usage: $0 {start|stop|restart|reload}"
1920- exit 1
1921-;;
1922-esac
1923-
1924-exit 0
1925diff --git a/debian/swift-object.swift-object-replicator.init.in b/debian/swift-object.swift-object-replicator.init.in
1926new file mode 100644
1927index 0000000..22f48f9
1928--- /dev/null
1929+++ b/debian/swift-object.swift-object-replicator.init.in
1930@@ -0,0 +1,17 @@
1931+#! /bin/sh
1932+### BEGIN INIT INFO
1933+# Provides: swift-object-replicator
1934+# Required-Start: $remote_fs
1935+# Required-Stop: $remote_fs
1936+# Default-Start: 2 3 4 5
1937+# Default-Stop: 0 1 6
1938+# Short-Description: Swift object replicator
1939+# Description: Object replicator server for Swift.
1940+### END INIT INFO
1941+
1942+PROJECT_NAME=swift
1943+NAME="${PROJECT_NAME}-object-replicator"
1944+DESC="OpenStack Swift object replicator"
1945+CONFIG=object-server
1946+MULTI=1
1947+SYSTEMD_DOC="man:${NAME}(1)"
1948diff --git a/debian/swift-object.swift-object-replicator.upstart b/debian/swift-object.swift-object-replicator.upstart
1949deleted file mode 100644
1950index 6666e0d..0000000
1951--- a/debian/swift-object.swift-object-replicator.upstart
1952+++ /dev/null
1953@@ -1,20 +0,0 @@
1954-# swift-object-replicator - SWIFT Object Replicator
1955-#
1956-# The swift object replicator.
1957-
1958-description "SWIFT Object Replicator"
1959-author "Marc Cluet <marc.cluet@ubuntu.com>"
1960-
1961-start on runlevel [2345]
1962-stop on runlevel [016]
1963-
1964-pre-start script
1965- if [ -f "/etc/swift/object-server.conf" ]; then
1966- exec /usr/bin/swift-init object-replicator start
1967- else
1968- exit 1
1969- fi
1970-end script
1971-
1972-post-stop exec /usr/bin/swift-init object-replicator stop
1973-
1974diff --git a/debian/swift-object.swift-object-updater.init b/debian/swift-object.swift-object-updater.init
1975deleted file mode 100644
1976index 8430640..0000000
1977--- a/debian/swift-object.swift-object-updater.init
1978+++ /dev/null
1979@@ -1,49 +0,0 @@
1980-#! /bin/sh
1981-### BEGIN INIT INFO
1982-# Provides: swift-object-updater
1983-# Required-Start: $remote_fs
1984-# Required-Stop: $remote_fs
1985-# Default-Start: 2 3 4 5
1986-# Default-Stop: 0 1 6
1987-# Short-Description: Swift object updater
1988-# Description: Object updater for swift.
1989-### END INIT INFO
1990-
1991-SERVICE_NAME="object-updater"
1992-PRINT_NAME="Swift object updater"
1993-
1994-. /lib/lsb/init-functions
1995-
1996-if ! [ -x /usr/bin/swift-init ] ; then
1997- exit 0
1998-fi
1999-
2000-if ! [ -f "/etc/swift/object-server.conf" ] ; then
2001- exit 6
2002-fi
2003-
2004-case "$1" in
2005-start)
2006- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
2007- /usr/bin/swift-init ${SERVICE_NAME} start
2008- log_end_msg $?
2009-;;
2010-stop)
2011- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
2012- /usr/bin/swift-init ${SERVICE_NAME} stop
2013- log_end_msg $?
2014-;;
2015-restart|force-reload|reload)
2016- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
2017- /usr/bin/swift-init ${SERVICE_NAME} reload
2018-;;
2019-status)
2020- exec /usr/bin/swift-init ${SERVICE_NAME} status
2021-;;
2022-*)
2023- echo "Usage: $0 {start|stop|restart|reload}"
2024- exit 1
2025-;;
2026-esac
2027-
2028-exit 0
2029diff --git a/debian/swift-object.swift-object-updater.init.in b/debian/swift-object.swift-object-updater.init.in
2030new file mode 100644
2031index 0000000..651f3a5
2032--- /dev/null
2033+++ b/debian/swift-object.swift-object-updater.init.in
2034@@ -0,0 +1,17 @@
2035+#! /bin/sh
2036+### BEGIN INIT INFO
2037+# Provides: swift-object-updater
2038+# Required-Start: $remote_fs
2039+# Required-Stop: $remote_fs
2040+# Default-Start: 2 3 4 5
2041+# Default-Stop: 0 1 6
2042+# Short-Description: Swift object updater
2043+# Description: Object updater server for Swift.
2044+### END INIT INFO
2045+
2046+PROJECT_NAME=swift
2047+NAME="${PROJECT_NAME}-object-updater"
2048+DESC="OpenStack Swift object updater"
2049+CONFIG=object-server
2050+MULTI=1
2051+SYSTEMD_DOC="man:${NAME}(1)"
2052diff --git a/debian/swift-object.swift-object-updater.upstart b/debian/swift-object.swift-object-updater.upstart
2053deleted file mode 100644
2054index 3c028bf..0000000
2055--- a/debian/swift-object.swift-object-updater.upstart
2056+++ /dev/null
2057@@ -1,20 +0,0 @@
2058-# swift-object-updater - SWIFT Object Updater
2059-#
2060-# The swift object updater.
2061-
2062-description "SWIFT Object Updater"
2063-author "Marc Cluet <marc.cluet@ubuntu.com>"
2064-
2065-start on runlevel [2345]
2066-stop on runlevel [016]
2067-
2068-pre-start script
2069- if [ -f "/etc/swift/object-server.conf" ]; then
2070- exec /usr/bin/swift-init object-updater start
2071- else
2072- exit 1
2073- fi
2074-end script
2075-
2076-post-stop exec /usr/bin/swift-init object-updater stop
2077-
2078diff --git a/debian/swift-object.swift-object.init.in b/debian/swift-object.swift-object.init.in
2079new file mode 100644
2080index 0000000..047ac51
2081--- /dev/null
2082+++ b/debian/swift-object.swift-object.init.in
2083@@ -0,0 +1,17 @@
2084+#! /bin/sh
2085+### BEGIN INIT INFO
2086+# Provides: swift-object
2087+# Required-Start: $remote_fs
2088+# Required-Stop: $remote_fs
2089+# Default-Start: 2 3 4 5
2090+# Default-Stop: 0 1 6
2091+# Short-Description: Swift object server
2092+# Description: Object server for Swift.
2093+### END INIT INFO
2094+
2095+PROJECT_NAME=swift
2096+NAME="${PROJECT_NAME}-object-server"
2097+DESC="OpenStack Swift object server"
2098+CONFIG=object-server
2099+MULTI=1
2100+SYSTEMD_DOC="man:${NAME}(1)"
2101diff --git a/debian/swift-object.upstart b/debian/swift-object.upstart
2102deleted file mode 100644
2103index 3ef4324..0000000
2104--- a/debian/swift-object.upstart
2105+++ /dev/null
2106@@ -1,20 +0,0 @@
2107-# swift-object-server - SWIFT Object Server
2108-#
2109-# The swift object server.
2110-
2111-description "SWIFT Object Server"
2112-author "Marc Cluet <marc.cluet@ubuntu.com>"
2113-
2114-start on runlevel [2345]
2115-stop on runlevel [016]
2116-
2117-pre-start script
2118- if [ -f "/etc/swift/object-server.conf" ]; then
2119- exec /usr/bin/swift-init object-server start
2120- else
2121- exit 1
2122- fi
2123-end script
2124-
2125-post-stop exec /usr/bin/swift-init object-server stop
2126-
2127diff --git a/debian/swift-proxy.init b/debian/swift-proxy.init
2128deleted file mode 100644
2129index 7a2193a..0000000
2130--- a/debian/swift-proxy.init
2131+++ /dev/null
2132@@ -1,49 +0,0 @@
2133-#! /bin/sh
2134-### BEGIN INIT INFO
2135-# Provides: swift-proxy
2136-# Required-Start: $remote_fs
2137-# Required-Stop: $remote_fs
2138-# Default-Start: 2 3 4 5
2139-# Default-Stop: 0 1 6
2140-# Short-Description: Swift proxy server
2141-# Description: Proxy server for swift.
2142-### END INIT INFO
2143-
2144-SERVICE_NAME="proxy-server"
2145-PRINT_NAME="Swift proxy server"
2146-
2147-. /lib/lsb/init-functions
2148-
2149-if ! [ -x /usr/bin/swift-init ] ; then
2150- exit 0
2151-fi
2152-
2153-if ! [ -f "/etc/swift/proxy-server.conf" ] ; then
2154- exit 6
2155-fi
2156-
2157-case "$1" in
2158-start)
2159- log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
2160- /usr/bin/swift-init ${SERVICE_NAME} start
2161- log_end_msg $?
2162-;;
2163-stop)
2164- log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
2165- /usr/bin/swift-init ${SERVICE_NAME} stop
2166- log_end_msg $?
2167-;;
2168-restart|force-reload|reload)
2169- log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
2170- /usr/bin/swift-init ${SERVICE_NAME} reload
2171-;;
2172-status)
2173- exec /usr/bin/swift-init ${SERVICE_NAME} status
2174-;;
2175-*)
2176- echo "Usage: $0 {start|stop|restart|reload}"
2177- exit 1
2178-;;
2179-esac
2180-
2181-exit 0
2182diff --git a/debian/swift-proxy.swift-proxy.init.in b/debian/swift-proxy.swift-proxy.init.in
2183new file mode 100644
2184index 0000000..1ae17ac
2185--- /dev/null
2186+++ b/debian/swift-proxy.swift-proxy.init.in
2187@@ -0,0 +1,17 @@
2188+#! /bin/sh
2189+### BEGIN INIT INFO
2190+# Provides: swift-proxy
2191+# Required-Start: $remote_fs
2192+# Required-Stop: $remote_fs
2193+# Default-Start: 2 3 4 5
2194+# Default-Stop: 0 1 6
2195+# Short-Description: Swift proxy server
2196+# Description: Proxy server for Swift.
2197+### END INIT INFO
2198+
2199+PROJECT_NAME=swift
2200+NAME="${PROJECT_NAME}-proxy-server"
2201+DESC="OpenStack Swift proxy server"
2202+CONFIG=proxy-server
2203+MULTI=1
2204+SYSTEMD_DOC="man:${NAME}(1)"
2205diff --git a/debian/swift-proxy.upstart b/debian/swift-proxy.upstart
2206deleted file mode 100644
2207index 8947c51..0000000
2208--- a/debian/swift-proxy.upstart
2209+++ /dev/null
2210@@ -1,20 +0,0 @@
2211-# swift-proxy - SWIFT Proxy Server
2212-#
2213-# The swift proxy server.
2214-
2215-description "SWIFT Proxy Server"
2216-author "Marc Cluet <marc.cluet@ubuntu.com>"
2217-
2218-start on runlevel [2345]
2219-stop on runlevel [016]
2220-
2221-pre-start script
2222- if [ -f "/etc/swift/proxy-server.conf" ]; then
2223- exec /usr/bin/swift-init proxy-server start
2224- else
2225- exit 1
2226- fi
2227-end script
2228-
2229-post-stop exec /usr/bin/swift-init proxy-server stop
2230-

Subscribers

People subscribed via source and target branches