Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
6f2db37dff | |||
842662f3d5 | |||
d9f22bf634 |
@@ -7,4 +7,3 @@ Services
|
|||||||
--------
|
--------
|
||||||
A service is a script in the ssm's init.d directory.
|
A service is a script in the ssm's init.d directory.
|
||||||
By default it's /etc/ssm/init.d for system services and $XDG_CONFIG_HOME/ssm/init.d for user ones.
|
By default it's /etc/ssm/init.d for system services and $XDG_CONFIG_HOME/ssm/init.d for user ones.
|
||||||
ssm creates relevant dirs if they don't exist.
|
|
||||||
|
20
ssm
20
ssm
@@ -280,6 +280,7 @@ info() {
|
|||||||
"$_status_label" "$_status"
|
"$_status_label" "$_status"
|
||||||
"Exec" "${service_command[*]} ${service_args[*]}"
|
"Exec" "${service_command[*]} ${service_args[*]}"
|
||||||
"Respawn" "${service_respawn:-false}"
|
"Respawn" "${service_respawn:-false}"
|
||||||
|
"Config path" "${service_config}"
|
||||||
)
|
)
|
||||||
|
|
||||||
[[ "$_status" == 'yes' ]] && {
|
[[ "$_status" == 'yes' ]] && {
|
||||||
@@ -349,9 +350,18 @@ main() {
|
|||||||
default XDG_CONFIG_HOME "$HOME/.config"
|
default XDG_CONFIG_HOME "$HOME/.config"
|
||||||
default XDG_RUNTIME_DIR "/run/user/$UID"
|
default XDG_RUNTIME_DIR "/run/user/$UID"
|
||||||
|
|
||||||
service_path=( "$XDG_CONFIG_HOME/ssm/init.d" )
|
service_path=( "$XDG_CONFIG_HOME/ssm/services" )
|
||||||
cfg_path=( "$XDG_CONFIG_HOME/ssm" )
|
cfg_path=( "$XDG_CONFIG_HOME/ssm" )
|
||||||
|
|
||||||
|
# Warn the user of deprecated stuff.
|
||||||
|
if [[ -d "$XDG_CONFIG_HOME/ssm/init.d" ]]; then
|
||||||
|
printf 'WARNING: `%s` was renamed to `%s`! Please move your scripts accordingly!\n' \
|
||||||
|
"$XDG_CONFIG_HOME/ssm/init.d" \
|
||||||
|
"$XDG_CONFIG_HOME/ssm/services" >&2
|
||||||
|
|
||||||
|
service_path+=( "$XDG_CONFIG_HOME/ssm/init.d" )
|
||||||
|
fi
|
||||||
|
|
||||||
rundir="$XDG_RUNTIME_DIR/ssm"
|
rundir="$XDG_RUNTIME_DIR/ssm"
|
||||||
logdir="$HOME/log/ssm"
|
logdir="$HOME/log/ssm"
|
||||||
else
|
else
|
||||||
@@ -359,8 +369,14 @@ main() {
|
|||||||
logdir='/var/log/ssm'
|
logdir='/var/log/ssm'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Warn the user of deprecated stuff.
|
||||||
|
if [[ -d "/etc/ssm/init.d" ]]; then
|
||||||
|
printf 'WARNING: `/etc/ssm/init.d` was renamed to `/etc/ssm/services`! Please move your scripts accordingly!\n' >&2
|
||||||
|
service_path+=( "/etc/ssm/init.d" )
|
||||||
|
fi
|
||||||
|
|
||||||
# Common service path
|
# Common service path
|
||||||
service_path+=( '/etc/ssm/init.d' "$rundir/services" "$usrdir/services" )
|
service_path+=( '/etc/ssm/services' "$rundir/services" "$usrdir/services" )
|
||||||
|
|
||||||
# Common config path
|
# Common config path
|
||||||
cfg_path+=( '/etc/ssm/conf.d' )
|
cfg_path+=( '/etc/ssm/conf.d' )
|
||||||
|
Reference in New Issue
Block a user