Browse Source

Transform bkctld SysVinit script into systemd oneshot service

pull/7/head
Victor Laborie 2 years ago
parent
commit
8fa127c591
3 changed files with 15 additions and 42 deletions
  1. +1
    -0
      Vagrantfile
  2. +14
    -0
      bkctld.service
  3. +0
    -42
      bkctld.sysvinit

+ 1
- 0
Vagrantfile 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
- 0
bkctld.service 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

+ 0
- 42
bkctld.sysvinit 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

Loading…
Cancel
Save