forked from evolix/evobackup
Transform bkctld SysVinit script into systemd oneshot service
This commit is contained in:
parent
f535b77f93
commit
cba53d8ae7
1
Vagrantfile
vendored
1
Vagrantfile
vendored
|
@ -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
14
bkctld.service
Normal 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
|
|
@ -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
|
Loading…
Reference in a new issue