31 Commits
1.0 ... 1.1

Author SHA1 Message Date
c36cea5240 base: remove suite66 support 2022-07-19 22:54:41 +02:00
57bcc7fee2 s6: remove scripts; deloyed with new s6-contrib 2022-05-24 21:33:26 +02:00
Qontinuum
da1975c606 Small changes on runit hooks (#20)
Co-authored-by: qontinuum <qontinuum@artixlinux.org>
Reviewed-on: #20
Co-authored-by: Qontinuum <qontinuum@artixlinux.org>
Co-committed-by: Qontinuum <qontinuum@artixlinux.org>
2022-05-22 12:51:18 +02:00
8ee6788925 s6: fix the help hook (#19)
Reviewed-on: #19
Co-authored-by: artoo <artoo@artixlinux.org>
Co-committed-by: artoo <artoo@artixlinux.org>
2022-04-10 21:59:06 +02:00
fda8182527 s6-db-reload refactor into case/esac 2022-04-10 13:23:24 -05:00
ca121a8621 s6-db-reload: improve print messages
Print the name of the new database and only show the suggestion about
deletion if -r isn't used.
2022-04-10 13:05:23 -05:00
c375c45283 s6-db-reload: add -h/--help argument 2022-04-10 13:05:23 -05:00
7ba882813a s6-db-reload: add -r/--remove argument
This removes all old databases.
2022-04-10 13:05:23 -05:00
f97c7d3041 s6-service: fix help 2022-04-10 18:49:53 +02:00
5090413f28 s6-db-reload: read a convfile on upgrades
This file is provided by s6-scripts. In most cases it is blank (does
nothing), but sometimes certain script updates will need special
instructions so they can write it here. The instructions are always a
one-time operation so the file is cleared afterwards.
2022-04-10 11:44:29 -05:00
315cb334f1 s6: remove s6-pre-remove.hook
Can cause less than desirable behavior and isn't truly needed.
2022-04-10 11:18:49 -05:00
b9d94c232e Merge pull request 's6' (#16) from s6 into master
Reviewed-on: #16
2022-04-10 16:55:53 +02:00
d0f03bc2c7 s6-db-reload: adopt new cmd name; use nanosecs 2022-04-10 15:46:47 +02:00
a71fa724f6 s6-service: drop echo 2022-04-10 14:46:02 +02:00
0bf78e4885 s6: rename scripts 2022-04-10 13:33:10 +02:00
c9a6659ec8 s6-rc-db-update: fix new line 2022-04-10 13:20:30 +02:00
3d909a640a s6-rc-db-update: kill echo 2022-04-10 13:18:18 +02:00
42a9f1a5ba s6-rc-bundle-update: remove s6-db-reload usage
The hook should call this at the end.
2022-04-09 17:17:17 -05:00
2b823adf5c s6-rc-bundle-update: rewrite and undeprecate
This is tool is now updated for touching/deleting files as per s6-rc.
2022-04-08 14:38:09 -05:00
0d93c640ec s6-rc-bundle-update: improve deprecation message
s6-db-reload is going to be the new way to handle this.
2022-01-24 10:05:49 -06:00
48aee2b67d s6-rc-bundle-update: print deprecation message
Instead of using this tool, users should use the new way of touching
files in a contents.d directory. Print a deprecation warning anytime
someone uses this.
2022-01-23 19:28:38 -06:00
f47aa4a061 s6-rc-db-update-hook: make saving bundles optional
This hook has some complicated logic for preserving bundle contents in
live bundles (i.e a bundle added by s6-rc-bundle) after a database
update. It works OK, but this interface is being moved away from and
instead users should touch files in the appropriate contents.d
directory. Because of how the bundle preservation logic in this hook
works, it would lead to cases where removing a file in contents.d and
then updating the database would preserve the service in the bundle
(despite the user's obvious intention to remove the service from the
bundle). This is not really feasible to fix. Instead,
s6-rc-db-update-hook will read /etc/s6/config/s6-rc-db-update.conf. If
it has a single line containing "true" in it (this will be the default
for now in s6-base in order to not break things), then the bundle
preservation logic is still executed. A user can easily turn this off by
simply changing it to be false (this will be the default sometime in the
future).
2022-01-23 19:21:39 -06:00
8f970e6b6a Revert live alpm hook commits
It was decided that this logic would be better served in the
live-services source. This reverts the previous 3 commits completely.
2022-01-20 19:37:57 -06:00
10f0b56b79 live: add to makefile 2022-01-20 16:43:19 -06:00
a8a445f2e6 liveservices-hook: Add 66-specific setup
Signed-off-by: strajder <strajder@artixlinux.org>
2022-01-20 23:30:09 +01:00
bc2867b1cd add alpm-hook for live services
Only s6 and suite66 actually need to use this.
2022-01-20 16:20:49 -06:00
29cd296aa4 dinit: make it possible to install dinit in conjunction with openrc, etc. 2021-11-13 08:57:14 +07:00
185c4b2e51 dinit: fix dinit hookscripts 2021-11-04 21:12:20 +07:00
d2362e98e5 fix dinit hook places 2021-11-04 18:29:14 +07:00
4e4451be73 Merge pull request 'dinit: initial support' (#11) from konimex/alpm-hooks:master into master
Reviewed-on: #11
2021-11-04 12:20:38 +01:00
948388bb18 dinit: initial support 2021-11-04 14:30:35 +07:00
25 changed files with 110 additions and 455 deletions

View File

@@ -16,18 +16,16 @@ RUNITHOOKS = $(wildcard runit/hooks/*)
S6SCRIPTS = $(wildcard s6/scripts/*)
S6HOOKS = $(wildcard s6/hooks/*)
S6EXTRA = s6/s6-rc-bundle-update
S6CRONIEHOOKS = $(wildcard s6/cronie-hooks/*)
S6DBUSHOOKS = $(wildcard s6/dbus-hooks/*)
S6ATDHOOKS = $(wildcard s6/atd-hooks/*)
SUITE66SCRIPTS = $(wildcard suite66/scripts/*)
SUITE66HOOKS = $(wildcard suite66/hooks/*)
DINITSCRIPTS = $(wildcard dinit/scripts/*)
DINITHOOKS = $(wildcard dinit/hooks/*)
SUITE66CRONIEHOOKS = $(wildcard suite66/cronie-hooks/*)
SUITE66DBUSHOOKS = $(wildcard suite66/dbus-hooks/*)
SUITE66ATDHOOKS = $(wildcard suite66/atd-hooks/*)
DINITCRONIEHOOKS = $(wildcard dinit/cronie-hooks/*)
DINITDBUSHOOKS = $(wildcard dinit/dbus-hooks/*)
DINITATDHOOKS = $(wildcard dinit/atd-hooks/*)
UDEVSCRIPTS = $(wildcard udev/scripts/*)
UDEVHOOKS = $(wildcard udev/hooks/*)
@@ -50,10 +48,6 @@ install_common:
install_hook_common:
install $(DMODE) $(DESTDIR)$(HOOKSDIR)
install_s6_extra:
install $(DMODE) $(DESTDIR)$(PREFIX)/bin
install $(EMODE) $(S6EXTRA) $(DESTDIR)$(PREFIX)/bin
install_base: install_common
install $(EMODE) $(BASESCRIPTS) $(DESTDIR)$(SCRIPTSDIR)
install $(MODE) $(BASEHOOKS) $(DESTDIR)$(HOOKSDIR)
@@ -76,13 +70,13 @@ install_runit: install_common
install $(EMODE) $(RUNITSCRIPTS) $(DESTDIR)$(SCRIPTSDIR)
install $(MODE) $(RUNITHOOKS) $(DESTDIR)$(HOOKSDIR)
install_s6: install_common install_s6_extra
install_s6: install_common
install $(EMODE) $(S6SCRIPTS) $(DESTDIR)$(SCRIPTSDIR)
install $(MODE) $(S6HOOKS) $(DESTDIR)$(HOOKSDIR)
install_suite66: install_common
install $(EMODE) $(SUITE66SCRIPTS) $(DESTDIR)$(SCRIPTSDIR)
install $(MODE) $(SUITE66HOOKS) $(DESTDIR)$(HOOKSDIR)
install_dinit: install_common
install $(EMODE) $(DINITSCRIPTS) $(DESTDIR)$(SCRIPTSDIR)
install $(MODE) $(DINITHOOKS) $(DESTDIR)$(HOOKSDIR)
install_openrc_cronie: install_hook_common
install $(MODE) $(OPENRCCRONIEHOOKS) $(DESTDIR)$(HOOKSDIR)
@@ -102,13 +96,13 @@ install_s6_at: install_hook_common
install_s6_dbus: install_hook_common
install $(MODE) $(S6DBUSHOOKS) $(DESTDIR)$(HOOKSDIR)
install_suite66_cronie: install_hook_common
install $(MODE) $(SUITE66CRONIEHOOKS) $(DESTDIR)$(HOOKSDIR)
install_dinit_cronie: install_hook_common
install $(MODE) $(DINITCRONIEHOOKS) $(DESTDIR)$(HOOKSDIR)
install_suite66_dbus: install_hook_common
install $(MODE) $(SUITE66DBUSHOOKS) $(DESTDIR)$(HOOKSDIR)
install_dinit_at: install_hook_common
install $(MODE) $(DINITATDHOOKS) $(DESTDIR)$(HOOKSDIR)
install_suite66_at: install_hook_common
install $(MODE) $(SUITE66ATDHOOKS) $(DESTDIR)$(HOOKSDIR)
install_dinit_dbus: install_hook_common
install $(MODE) $(DINITDBUSHOOKS) $(DESTDIR)$(HOOKSDIR)
.PHONY: install install_base install_s6 install_openrc install_runit install_suite66
.PHONY: install install_base install_s6 install_openrc install_runit install_dinit

View File

@@ -5,7 +5,7 @@ Type = Path
Target = usr/bin/openrc-init
Target = usr/bin/runit-init
Target = usr/bin/s6-init
Target = usr/bin/suite66-init
Target = usr/bin/dinit-init
[Action]
Description = Setting init symlink ...

View File

@@ -11,7 +11,7 @@ init_conf(){
}
init_detect(){
artix_inits="openrc-init runit-init s6-init suite66-init"
artix_inits="openrc-init runit-init s6-init dinit-init"
for supported in ${artix_inits}; do
bin=/usr/bin/"$supported"
if [ -f "$bin" ];then

View File

@@ -6,4 +6,4 @@ Target = glibc
[Action]
Description = Restarting atd for libc upgrade...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/66-hook longrun_restart atd
Exec = /usr/share/libalpm/scripts/dinit-hook restart atd

View File

@@ -6,4 +6,4 @@ Target = glibc
[Action]
Description = Restarting cronie for libc upgrade...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/66-hook longrun_restart cronie
Exec = /usr/share/libalpm/scripts/dinit-hook restart cronie

View File

@@ -10,4 +10,4 @@ Target = usr/share/dbus-1/system-services/*.service
[Action]
Description = Reloading system bus configuration...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/66-hook dbus_reload
Exec = /usr/share/libalpm/scripts/dinit-hook dbus_reload

View File

@@ -7,5 +7,5 @@ Target = usr/lib/binfmt.d/*.conf
[Action]
Description = Registering binary formats...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/66-hook binfmt
Exec = /usr/share/libalpm/scripts/dinit-hook binfmt
NeedsTargets

View File

@@ -8,5 +8,5 @@ Target = usr/lib/sysctl.d/*.conf
[Action]
Description = Applying kernel sysctl settings...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/66-hook sysctl
Exec = /usr/share/libalpm/scripts/dinit-hook sysctl
NeedsTargets

View File

@@ -0,0 +1,11 @@
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = etc/dinit.d/*
[Action]
Description = Displaying dinit service help ...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/dinit-hook add
NeedsTargets

View File

@@ -0,0 +1,10 @@
[Trigger]
Type = Path
Operation = Remove
Target = etc/dunit.d/*
[Action]
Description = Displaying dinit service help ...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/dinit-hook del
NeedsTargets

59
dinit/scripts/dinit-hook Normal file
View File

@@ -0,0 +1,59 @@
#!/bin/sh -e
dinit_live() {
if [ ! -S /run/dinitctl ]; then
echo >&2 " Skipped: Current root is not booted."
exit 0
fi
}
svc_help(){
echo " ==> Start/stop/restart a service:"
echo " dinitctl <start/stop/restart> <service>"
}
svc_add_help(){
echo " ==> Add a service:"
echo " dinitctl enable <service>"
svc_help
}
svc_del_help(){
echo " ==> Remove a service:"
echo " dinitctl disable <service>"
svc_help
}
each_conf() {
while read -r f; do
"$@" "/$f"
done
}
reload_dbus() {
dbus-send --print-reply --system --type=method_call \
--dest=org.freedesktop.DBus \
/ org.freedesktop.DBus.ReloadConfig > /dev/null
}
restart_service() {
if dinitctl list | grep -qF "[[+] ] $1"; then
dinitctl restart "$1"
fi
}
op="$1"; shift
case $op in
sysctl) dinit_live; each_conf /usr/bin/sysctl -q -p ;;
binfmt) dinit_live; /usr/bin/dinitctl restart binfmt ;;
dbus_reload) dinit_live; reload_dbus ;;
# For use by other packages
reload) dinit_live; /usr/bin/dinitctl reload "$@"; /usr/bin/dinitctl restart "$@" ;;
restart) dinit_live; restart_service "$1" ;;
add) svc_add_help ;;
del) svc_del_help ;;
*) echo >&2 " Invalid operation '$op'"; exit 1 ;;
esac
exit 0

View File

@@ -1,7 +1,6 @@
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = etc/runit/sv/*
[Action]

View File

@@ -14,13 +14,13 @@ svc_help(){
svc_add_help(){
echo " ==> Add a service:"
echo " ln -s /etc/runit/sv/<service> /run/runit/service/"
echo " ln -s ../../sv/<service> /run/runit/service/"
svc_help
}
svc_del_help(){
echo " ==> Remove a service:"
echo " rm /run/runit/service/<service>"
echo " unlink /run/runit/service/<service>"
svc_help
}

View File

@@ -1,10 +0,0 @@
[Trigger]
Type = Path
Operation = Remove
Target = etc/s6/sv/*
[Action]
Description = Shutting down services ...
When = PreTransaction
Exec = /usr/share/libalpm/scripts/s6-rc-hook shutdown_sv
NeedsTargets

View File

@@ -8,4 +8,4 @@ Target = etc/s6/sv/*
[Action]
Description = Updating s6-rc database...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/s6-rc-db-update-hook
Exec = /usr/bin/s6-db-reload

View File

@@ -1,170 +0,0 @@
#!/bin/sh
# {{{ functions
db_action() {
s6-rc-db -c "${DATABASE}" "$@"
}
bundle_action() {
s6-rc-bundle -c "${DATABASE}" "$@"
}
db_err_msg() {
echo "${CMD_UPD}: fatal: unable to take lock on ${DATABASE}: Permission denied"
exit 1
}
bundle_err_msg() {
echo "'${BUNDLE}' is not an existing bundle. Create it with ${CMD}."
exit 1
}
bundle_entry_err_msg() {
name="$1"
echo "'$name' does not exist in bundle '${BUNDLE}'!"
exit 1
}
bundle_add_err_msg() {
echo "Error when trying to add '${CONTENTS}'!"
}
cmd_help() {
echo "${CMD_UPD} help"
echo "${CMD_UPD} add bundlename contents..."
echo "${CMD_UPD} delete bundlename contents..."
echo "${CMD_UPD} list bundlename"
}
bundle_action_check() {
pos="$1"
num="$2"
if [ "$pos" -lt "$num" ]; then
echo "${HELP_MSG}"
exit 1
fi
isbundle=$(db_action type "${BUNDLE}" 2> /dev/null)
if [ "$?" = 111 ]; then
db_err_msg
fi
if [ "$isbundle" != "bundle" ]; then
bundle_err_msg
fi
}
bundle_to_backup() {
backup=$(db_action contents "${BUNDLE}")
for entry in ${CONTENTS}; do
isbundle=$(db_action type "$entry" 2> /dev/null)
entrycontents=$entry
if [ "$isbundle" = "bundle" ]; then
entrycontents=$(db_action contents "$entry")
fi
for srv in $entrycontents; do
if ! echo $backup | grep -w "$srv" > /dev/null; then
bundle_entry_err_msg "$entry"
else
oldupdated=""
for oldsrv in $backup; do
if [ "$oldsrv" != "$srv" ]; then
oldupdated="${oldupdated} $oldsrv"
fi
done
backup=$oldupdated
fi
done
done
echo "$backup"
}
cmd_add() {
pos="$1"
bundle_action_check "$pos" 3
old="$(db_action contents "${BUNDLE}")"
bundle_action delete "${BUNDLE}"
if ! bundle_action add "${BUNDLE}" $old ${CONTENTS}; then
bundle_add_err_msg
bundle_action add "${BUNDLE}" $old
fi
}
cmd_delete() {
pos="$1"
bundle_action_check "$pos" 3
old="$(bundle_to_backup)"
if [ "$?" = 1 ]; then
echo $old
exit 1
fi
bundle_action delete "${BUNDLE}"
bundle_action add "${BUNDLE}" $old
}
cmd_list() {
pos="$1"
bundle_action_check "$pos" 2
db_action contents "${BUNDLE}"
}
# }}}
BUNDLE=""
COMMAND=""
CONTENTS=""
DATABASE="/run/s6-rc/compiled"
CMD="s6-rc-bundle"
CMD_UPD="${CMD}-update"
HELP_MSG="${CMD_UPD}: usage: ${CMD_UPD} [ -c compiled ] command... (use ${CMD_UPD} help for more information)"
c_arg=false
for arg in "$@"; do
if [ "$c_arg" = true ]; then
DATABASE=$arg
c_arg=false
continue
fi
if [ "$arg" = "-c" ]; then
c_arg=true
continue
fi
if [ "${COMMAND}" = "" ]; then
COMMAND=$arg
continue
fi
if [ "${BUNDLE}" = "" ]; then
BUNDLE=$arg
continue
fi
if [ "${CONTENTS}" = "" ]; then
CONTENTS=$arg
continue
fi
CONTENTS="${CONTENTS} $arg"
done
case "${COMMAND}" in
help) cmd_help ;;
add) cmd_add "$#" ;;
delete) cmd_delete "$#" ;;
list) cmd_list "$#" ;;
*) echo "${HELP_MSG}" ;;
esac

View File

@@ -1,120 +0,0 @@
#!/bin/sh
# {{{ functions
db_action() {
s6-rc-db -c "${DBPATH}" "$@"
}
a_newbundle() {
for i in $new_bundles; do
if [ "$i" = "$1" ]; then
return 0
fi
done
return 1
}
service_exists() {
for j in $all_services; do
if [ "$j" = "$1" ]; then
return 0
fi
done
return 1
}
in_newbundle() {
bundle_contents=$(db_action contents "$1")
for k in $bundle_contents; do
if [ "$k" = "$2" ]; then
return 0
fi
done
return 1
}
# }}}
# main
RCPATH='/etc/s6/rc'
DBPATH="${RCPATH}/compiled"
SVPATH='/etc/s6/sv'
ADMINSVPATH='/etc/s6/adminsv'
FALLBACKSVPATH='/etc/s6/fallbacksv'
SVDIRS='/run/s6-rc/servicedirs'
TIMESTAMP=$(date +%s)
if [ -e "${DBPATH}" ]; then
# Print contents of older bundles, using the format:
# <name1>
# <sv1> <sv2> <sv3> ... <svN>
# <name2>
# <sv1> ... <svN>
old_bundle_contents=$(
for bundle in $(db_action list bundles); do
printf '%s\n' "$bundle" "$(db_action contents "$bundle" | paste -sd" ")"
done
)
fi
if ! s6-rc-compile "${DBPATH}"-"${TIMESTAMP}" "${SVPATH}" "${ADMINSVPATH}"; then
echo "Error compiling database. Trying the system fallback paths!"
echo "Please double check the ${ADMINSVPATH} directories."
if ! s6-rc-compile "${DBPATH}"-"${TIMESTAMP}" "${SVPATH}" "${FALLBACKSVPATH}"; then
echo "The system fallback compilation failed. Something is really wrong with your service directories!"
echo "Check your ${SVPATH} and ${FALLBACKSVPATH} directories."
fi
exit 1
fi
if [ -e "/run/s6-rc" ]; then
for dir in "${SVDIRS}"/*; do
if [ -e "${dir}/down" ]; then
s6-svc -x "${dir}"
fi
done
s6-rc-update "${DBPATH}"-"${TIMESTAMP}"
fi
if [ -d "${DBPATH}" ]; then
ln -sf "${DBPATH}"-"${TIMESTAMP}" "${DBPATH}"/compiled && mv -f "${DBPATH}"/compiled "${RCPATH}"
else
ln -sf "${DBPATH}"-"${TIMESTAMP}" "${DBPATH}"
fi
new_bundles=$(db_action list bundles)
all_services=$(db_action list all)
while read -r l && read -r old_contents; do
CMD='s6-rc-bundle'
a_newbundle "$l"
ret=$?
for m in $old_contents; do
# We should handle the service if it exists and either:
# [ $ret -eq 1 ] -> the bundle it is in not doesn't exist yet
# ! in_newbundle -> it's not in the bundle it used to be in
if service_exists "$m"; then
if [ $ret -eq 1 ] || ! in_newbundle "$l" "$m"; then
new_contents="$new_contents $m"
fi
fi
done
# If bundle exists, we're only going to update it
[ $ret -eq 1 ] || CMD="$CMD-update"
# Add or update bundle
[ -z "$new_contents" ] || "$CMD" -c "${DBPATH}" add "$l" $new_contents
new_contents=''
done <<EOF
$old_bundle_contents
EOF
echo "==> Switched to a new database."
echo " Remove any old unwanted/unneeded database directories in ${RCPATH}."

View File

@@ -10,17 +10,19 @@ s6_live() {
svc_help(){
echo " ==> Start/stop a service:"
echo " s6-rc -u/-d change <service>"
echo " ==> Recompile the service database:"
echo " s6-db-reload <args>"
}
svc_add_help(){
echo " ==> Add a service:"
echo " s6-rc-bundle-update add default <service>"
echo " s6-service add default <service>"
svc_help
}
svc_del_help(){
echo " ==> Remove a service:"
echo " s6-rc-bundle-update delete default <service>"
echo " s6-service delete default <service>"
svc_help
}
@@ -30,19 +32,6 @@ reload_dbus() {
/ org.freedesktop.DBus.ReloadConfig > /dev/null
}
shutdown_service() {
while read -r dir; do
if [ -d "$dir" ] && [ "$dir" != "etc/s6/sv/" ]; then
sv=$(basename "$dir")
active=$(s6-rc -a list | grep -Fx "$sv" || true)
if [ ! "$active" ]; then
continue
fi
s6-rc -d change "$sv"
fi
done
}
restart_service() {
if [ -e /run/s6-rc/servicedirs/"$1" ]; then
s6-svc -r /run/s6-rc/servicedirs/"$1"
@@ -68,7 +57,6 @@ case $op in
add) svc_add_help ;;
del) svc_del_help ;;
longrun_restart) s6_live; restart_service "$1" ;;
shutdown_sv) s6_live; shutdown_service ;;
*) echo >&2 " Invalid operation '$op'"; exit 1 ;;
esac

View File

@@ -1,10 +0,0 @@
[Trigger]
Operation = Upgrade
Type = Package
Target = suite66-scripts
Target = 66
[Action]
Description = Updating boot tree module
When = PostTransaction
Exec = /usr/share/libalpm/scripts/66-bootmodule

View File

@@ -1,11 +0,0 @@
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = etc/66/service/*
[Action]
Description = Displaying 66 service help ...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/66-hook add
NeedsTargets

View File

@@ -1,10 +0,0 @@
[Trigger]
Operation = Install
Type = Package
Target = suite66-base
Target = 66
[Action]
Description = Creating initial boot and default tree
When = PostTransaction
Exec = /usr/share/libalpm/scripts/66-postinstall

View File

@@ -1,10 +0,0 @@
[Trigger]
Type = Path
Operation = Remove
Target = etc/66/service/*
[Action]
Description = Displaying 66 service help ...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/66-hook del
NeedsTargets

View File

@@ -1,2 +0,0 @@
#!/usr/bin/sh
66-enable -t boot -F boot@system

View File

@@ -1,54 +0,0 @@
#!/bin/sh -e
suite66_live() {
if [ ! -d /run/dbus ]; then
echo >&2 " Skipped: 66 is not running."
exit 0
fi
}
svc_help(){
echo " ==> Start/stop a service:"
echo " 66-start <service>"
echo " 66-stop <service>"
}
svc_add_help(){
echo " ==> Add a service:"
echo " 66-enable <service>"
svc_help
}
svc_del_help(){
echo " ==> Remove a service:"
echo " 66-disable <service>"
svc_help
}
reload_dbus() {
dbus-send --print-reply --system --type=method_call \
--dest=org.freedesktop.DBus \
/ org.freedesktop.DBus.ReloadConfig > /dev/null
}
each_conf() {
while read -r f; do
"$@" "/$f"
done
}
op="$1"; shift
sv="$2"
case $op in
sysctl) suite66_live; each_conf /usr/bin/sysctl -q -p ;;
binfmt) suite66_live; /etc/66/script/binfmt.sh ;;
dbus_reload) suite66_live; reload_dbus ;;
# For use by other packages
add) svc_add_help ;;
del) svc_del_help ;;
longrun_restart) suite66_live; 66-svctl -r "$1" ;;
*) echo >&2 " Invalid operation '$op'"; exit 1 ;;
esac
exit 0

View File

@@ -1,9 +0,0 @@
#!/usr/bin/sh
if [ ! -d /var/lib/66/system/boot ]; then
66-tree -n boot
66-enable -t boot -F boot@system
fi
if [ ! -d /var/lib/66/system/default ]; then
66-tree -ncE default
fi