Transform bkctld SysVinit script into systemd oneshot service

This commit is contained in:
Victor LABORIE 2019-01-08 11:26:42 +01:00
parent 16d19b4a28
commit 8fa127c591
3 changed files with 15 additions and 42 deletions

1
Vagrantfile vendored
View File

@ -20,6 +20,7 @@ ln -fs /vagrant/lib /usr/lib/bkctld
ln -fs /vagrant/tpl /usr/share/bkctld
ln -fs /vagrant/bash_completion /usr/share/bash-completion/completions/bkctld
ln -fs /vagrant/bkctld.conf /etc/default/bkctld
ln -fs /vagrant/bkctld.service /etc/systemd/system/bkctld.service && systemctl daemon-reload
mkdir -p /usr/lib/nagios/plugins/
SCRIPT

14
bkctld.service Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Documentation=man:bkctld(8)
Description=Backup manager using rsync and OpenSSH chroot.
[Service]
Type=oneshot
ExecStart=/usr/sbin/bkctld start all
ExecStop=/usr/sbin/bkctld stop all
RemainAfterExit=true
KillMode=control-group
GuessMainPID=no
[Install]
WantedBy=multi-user.target

View File

@ -1,42 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: evobackup
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Backup manager using rsync and OpenSSH chroot.
### END INIT INFO
. /lib/lsb/init-functions
case "$1" in
start)
bkctld start all
;;
stop)
bkctld stop all
;;
reload|force-reload)
bkctld reload all
;;
restart)
bkctld restart all
;;
status)
bkctld status
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0