forked from ungleich-public/cdist
__daemontools fixes
make __daemontools more robust and clean up the --install-init-script confusion
This commit is contained in:
parent
f278a1e31f
commit
00f524773e
1 changed files with 29 additions and 27 deletions
|
@ -4,34 +4,36 @@ pkg=$(cat "$__object/parameter/from-package")
|
||||||
servicedir=$(cat "$__object/parameter/servicedir")
|
servicedir=$(cat "$__object/parameter/servicedir")
|
||||||
|
|
||||||
__package $pkg
|
__package $pkg
|
||||||
__directory $servicedir --mode 755
|
__directory $servicedir --mode 700
|
||||||
|
|
||||||
if [ -f "$__object/parameter/install-init-script" ]; then
|
os=$(cat "$__global/explorer/os")
|
||||||
os=$(cat "$__global/explorer/os")
|
init=$(cat "$__global/explorer/init")
|
||||||
init=$(cat "$__global/explorer/init")
|
|
||||||
|
|
||||||
case $init in
|
case $os in
|
||||||
init)
|
freebsd)
|
||||||
case $os in
|
# TODO change to __start_on_boot once it supports freebsd
|
||||||
freebsd)
|
__config_file /etc/rc.conf.d/svscan --source - <<-EOT
|
||||||
__config_file /etc/rc.conf.d/svscan --source - <<-EOT
|
svscan_enable="YES"
|
||||||
svscan_enable="YES"
|
svscan_servicedir="$servicedir"
|
||||||
svscan_servicedir="$servicedir"
|
EOT
|
||||||
EOT
|
require="$require __package/$pkg __directory/$servicedir __config_file/etc/rc.conf.d/svscan" \
|
||||||
require="$require __package/$pkg __directory/$servicedir __config_file/etc/rc.conf.d/svscan" \
|
__process svscan --name ".*/svscan $servicedir" --start 'service svscan start'
|
||||||
__process svscan --start 'service svscan start'
|
;;
|
||||||
;;
|
*)
|
||||||
*)
|
case $init in
|
||||||
|
init)
|
||||||
|
if [ -f "$__object/parameter/install-init-script" ]; then
|
||||||
__config_file /etc/init.d/svscan --mode 755 --source "$__type/files/init.d-svscan"
|
__config_file /etc/init.d/svscan --mode 755 --source "$__type/files/init.d-svscan"
|
||||||
require="$require __config_file/etc/init.d/svscan" __start_on_boot svscan
|
REQUIREEXTRA="__config_file/etc/init.d/svscan"
|
||||||
require="$require __package/$pkg __directory/$servicedir __start_on_boot/svscan" \
|
fi
|
||||||
__process svscan --start 'service svscan start'
|
require="$require $REQUIREEXTRA" __start_on_boot svscan
|
||||||
;;
|
require="$require __package/$pkg __directory/$servicedir __start_on_boot/svscan" \
|
||||||
esac
|
__process svscan --name ".*/svscan $servicedir" --start 'service svscan start'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Your init system ($init) is not supported by this type. Submit a patch at github.com/ungleich/cdist!"
|
echo "Your init system ($init) is not supported by this type. Submit a patch at github.com/ungleich/cdist!"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
|
Loading…
Reference in a new issue