13 Commits

Author SHA1 Message Date
Eric Vidal
7c08fd3298 add directory for user service 2016-05-26 21:09:03 +04:00
Eric Vidal
d8ded07d97 rename boot service directory 2016-05-26 21:08:38 +04:00
Eric Vidal
14255da33d change origin of database 2016-05-26 21:05:35 +04:00
Eric Vidal
227e9634e4 oops 2016-05-25 13:16:18 +04:00
Eric Vidal
bd944a7194 improve s6-svc zsh completion 2016-05-25 13:15:09 +04:00
Eric Vidal
a70d048192 improve completion for s6-svc 2016-05-24 21:38:50 +04:00
Eric Vidal
33e7d5b330 fix bug about supervision control 2016-05-23 20:10:50 +04:00
Eric Vidal
5134fa1da5 oops 2016-05-23 13:12:54 +04:00
Eric Vidal
2d95062402 add zsh completion for s6-svc 2016-05-23 13:10:28 +04:00
Eric Vidal
502e66ab40 add log for divers service 2016-05-19 18:42:36 +04:00
Eric Vidal
f0d29a96d4 change command for divers Signal 2016-05-19 18:39:17 +04:00
Eric Vidal
465df8bf18 load environment for svscan 2016-05-19 18:38:21 +04:00
Eric Vidal
d13bf1f770 call SIGUSR2 instead of SIGUSR1 2016-05-19 18:37:21 +04:00
102 changed files with 131 additions and 29 deletions

113
_s6-svc Normal file
View File

@@ -0,0 +1,113 @@
#compdef s6-svc
# completion for s6-svc
# Eric Vidal <eric@obarun.org>
# services in /run/s6/service. Change the path variable to suit your needs.
path_dir=/run/s6/service
typeset -A opt_args
_path() {
local list_dir
list_dir=( $path_dir/* )
compadd "$@" -a list_dir
}
_list_common=(
'-a[send a SIGALRM to the supervised process]'
'-b[send a SIGABRT to the supervised process]'
'-q[send a SIGQUIT to the supervised process]'
'-h[send a SIGHUP to the supervised process]'
'-k[send a SIGKILL to the supervised process]'
'-t[send a SIGTERM to the supervised process]'
'-i[send a SIGINT to the supervised process]'
'-1[send a SIGUSR1 to the supervised process]'
'-2[send a SIGUSR2 to the supervised process]'
'-p[send a SIGSTOP to the supervised process]'
'-c[send a SIGCONT to the supervised process]'
'-y[send a SIGWINCH to the supervised process]'
'-o[once. Equivalent to -uO]'
'-d[down]'
'-u[up]'
'-x[exit]'
'-X[close fds and exit]'
'-O[Once at most. Do not restart when it dies]'
'-T[timeout]'
)
_list_special=(
'-wd[s6-svc will not exit until the service is down]'
'-wD[s6-svc will not exit until the service is down and ready to be brought up]'
'-wu[s6-svc will not exit until the service is up]'
'-wU[s6-svc will not exit until the service is up and ready]'
'-wr[s6-svc will not exit until the service has been started or restarted]'
'-wR[same as -wr but need to be notified readiness]'
)
_svc_action_none() {
_arguments \
"$_list_common[@]" \
"$_list_special[@]"
}
_svc() {
local context line i
typeset -A opt_args
case $words[CURRENT] in
*wd*|*wD*|*wu*|*wU*|*wr*|*wR*)
_arguments -s : \
"$_list_common[@]" \
"$_list_special[@]" \
'*:service:_path'
;;
*a*|*b*|*q*|*h*|*k*|*t*|*i*|*1*|*2*|*p*|*c*|*y*|*o*|*d*|*u*|*x*|*X*|*O*)
if [[ $words[CURRENT] == -*T ]]; then
_arguments : \
':\if the -wstate option has been given, -T specifies a timeout in milliseconds: ' \
'*:service:_path'
else
_arguments -s : \
"$_list_common[@]" \
"$_list_special[@]" \
'*:service:_path'
fi
;;
-T)
_arguments -s : \
':if the -wstate option has been given, -T specifies a timeout in milliseconds: ' \
'*:service:_path'
;;
*) i=$#;
while [[ $words[$i] != "s6-svc" ]];do
if [[ $words[$i] == -* ]]; then
break
else
i=$(($i-1))
fi
done
case $i in
-*)
if [[ $words[$i] != "s6-svc" ]]; then
_arguments -s : \
"$_list_common[@]" \
"$_list_special[@]" \
'*:service:_path'
else
_message "enter a - character to begin the completion"
fi
;;
*)
_svc_action_none
;;
esac
;;
esac
}
_svc "$@"

3
init
View File

@@ -58,7 +58,7 @@ if {
import -i svc-serv import -i svc-serv
foreground { foreground {
if { cp -a ${svc-serv} /run/s6 } if { cp -a ${svc-serv} /run/s6 }
cp -a /etc/s6/rc-serv /run/.rc-serv cp -a /etc/s6/.rc-serv /run/
} }
# Create symlink to /run/s6-run # Create symlink to /run/s6-run
@@ -85,4 +85,5 @@ background {
unexport ! unexport !
fdmove -c 2 1 fdmove -c 2 1
s6-envdir -I /run/s6-run/service/.s6-svscan/
s6-svscan -st0 /run/s6-run/service s6-svscan -st0 /run/s6-run/service

View File

@@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
exec /run/s6-run/service/.s6-svscan/SIGUSR1 exec /run/s6-run/service/.s6-svscan/SIGUSR2

View File

@@ -0,0 +1 @@
udevd-pipe

View File

@@ -0,0 +1 @@
udevd-udevdlog

View File

@@ -0,0 +1 @@
udevadm-pipe

View File

@@ -0,0 +1 @@
udevd-udevadmlog

View File

@@ -1,4 +1,4 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 #fdmove -c 2 1
s6-devd s6-devd
/usr/bin/udevadm settle /usr/bin/udevadm settle

View File

@@ -1,4 +0,0 @@
user-dbus
#user-dbuslog
user-dhcpcd
#user-dhcpcdlog

View File

@@ -1,3 +0,0 @@
#!/usr/local/bin/execlineb -P
/usr/bin/rm -rf /run/dbus/

View File

@@ -1,5 +0,0 @@
#!/usr/local/bin/execlineb -P
fdmove -c 2 1
if { s6-mkdir -p -m 0755 /run/dbus }
foreground { dbus-uuidgen --ensure }
dbus-daemon --nofork --nopidfile --config-file=/usr/share/dbus-1/system.conf

View File

@@ -1 +0,0 @@
longrun

View File

@@ -1 +0,0 @@
all-Boot

View File

@@ -1,3 +0,0 @@
#!/usr/local/bin/execlineb -P
/usr/bin/rm -f /run/dhcpcd.*

View File

@@ -1,3 +0,0 @@
#!/usr/local/bin/execlineb -P
fdmove -c 2 1
dhcpcd -B

View File

@@ -1 +0,0 @@
longrun

View File

@@ -0,0 +1,4 @@
# NEVER ERASE this services below if you do not know what you are doing.
boot-ready
# Enter the desire services/bundle names below this lines.

View File

@@ -0,0 +1 @@
oneshot

View File

1
s6-serv/enabled/all-User Symbolic link
View File

@@ -0,0 +1 @@
/etc/s6-serv/available/all-User

1
s6-serv/enabled/boot-ready Symbolic link
View File

@@ -0,0 +1 @@
/etc/s6-serv/available/boot-ready

View File

@@ -1,5 +1,4 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
#foreground { s6-rc -v 3 -da change }
foreground { /etc/stage2.tini } foreground { /etc/stage2.tini }
s6-svscanctl -6 /run/s6-run/service s6-svscanctl -6 -- /run/s6-run/service

Some files were not shown because too many files have changed in this diff Show More