Compare commits
3 commits
master
...
daemontool
Author | SHA1 | Date | |
---|---|---|---|
e32d0d1ce7 | |||
e9b09e954b | |||
e75cb325bc |
4 changed files with 28 additions and 4 deletions
|
@ -21,11 +21,16 @@ OPTIONAL PARAMETERS
|
||||||
from-package
|
from-package
|
||||||
Package to install. Must be compatible with the original daemontools. Example: daemontools-encore. Default: daemontools.
|
Package to install. Must be compatible with the original daemontools. Example: daemontools-encore. Default: daemontools.
|
||||||
|
|
||||||
|
servicedir
|
||||||
|
Directory to scan for services. Default: `/service`
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN PARAMETERS
|
BOOLEAN PARAMETERS
|
||||||
------------------
|
------------------
|
||||||
install-init-script
|
install-init-script
|
||||||
Add an init script and set it to start on boot.
|
Add an init script and set it to start on boot.
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,34 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
pkg=$(cat "$__object/parameter/from-package")
|
pkg=$(cat "$__object/parameter/from-package")
|
||||||
|
servicedir=$(cat "$__object/parameter/servicedir")
|
||||||
|
|
||||||
__package $pkg
|
__package $pkg
|
||||||
|
__directory $servicedir --mode 755
|
||||||
|
|
||||||
if [ -f "$__object/parameter/install-init-script" ]; then
|
if [ -f "$__object/parameter/install-init-script" ]; then
|
||||||
|
os=$(cat "$__global/explorer/os")
|
||||||
init=$(cat "$__global/explorer/init")
|
init=$(cat "$__global/explorer/init")
|
||||||
|
|
||||||
case $init in
|
case $init in
|
||||||
init)
|
init)
|
||||||
__config_file /etc/init.d/svscan --mode 755 --source "$__type/files/init.d-svscan"
|
case $os in
|
||||||
require="$require __config_file/etc/init.d/svscan" __start_on_boot svscan
|
freebsd)
|
||||||
require="$require __start_on_boot/svscan" __process svscan --start 'service svscan start'
|
__config_file /etc/rc.conf.d/svscan --source - <<-EOT
|
||||||
;;
|
svscan_enable="YES"
|
||||||
|
svscan_servicedir="$servicedir"
|
||||||
|
EOT
|
||||||
|
require="$require __package/$pkg __directory/$servicedir __config_file/etc/rc.conf.d/svscan" \
|
||||||
|
__process svscan --start 'service svscan start'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
__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
|
||||||
|
require="$require __package/$pkg __directory/$servicedir __start_on_boot/svscan" \
|
||||||
|
__process svscan --start 'service svscan start'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
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
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
/service
|
|
@ -1 +1,2 @@
|
||||||
from-package
|
from-package
|
||||||
|
servicedir
|
||||||
|
|
Loading…
Reference in a new issue