ALT Linux Bugzilla
– Attachment 4836 Details for
Bug 24989
add systemd support
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
proposed change
service-systemd.diff (text/plain), 1.31 KB, created by
Dmitry V. Levin
on 2011-03-14 20:41:04 MSK
(
hide
)
Description:
proposed change
Filename:
MIME Type:
Creator:
Dmitry V. Levin
Created:
2011-03-14 20:41:04 MSK
Size:
1.31 KB
patch
obsolete
>diff --git a/service/service b/service/service >index 2e5b421..d422571 100644 >--- a/service/service >+++ b/service/service >@@ -8,7 +8,10 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin > export PATH > > VERSION="service version 0.91-alt" >-SERVICEDIR="/etc/init.d" >+SERVICEDIR=/etc/init.d >+SYSTEMCTL=/bin/systemctl >+SYSTEMD_SERVICE_DIR=/lib/systemd/system >+SYSTEMD_CGROUP_DIR=/sys/fs/cgroup/systemd > SERVICE= > OPTIONS= > >@@ -30,13 +33,30 @@ usage() > [ -n "$1" ] && exit "$1" || exit > } > >+systemd_status= >+systemd_is_active() >+{ >+ if [ -z "$systemd_status" ]; then >+ [ -x "$SYSTEMCTL" -a \ >+ -d "$SYSTEMD_CGROUP_DIR" ] && >+ mountpoint -q "$SYSTEMD_CGROUP_DIR" >+ systemd_status=$? >+ fi >+ return $systemd_status >+} >+ > check_service() > { > [ -n "${SERVICE##*/*}" ] || > fatal "$SERVICE: Invalid service name" > >- [ -x "$SERVICEDIR/$SERVICE" ] || >- fatal "$SERVICE: Unrecognized service" >+ [ -x "$SERVICEDIR/$SERVICE" ] && return 0 >+ >+ [ -f "$SYSTEMD_SERVICE_DIR/$SERVICE.service" ] && >+ systemd_is_active && >+ return 0 >+ >+ fatal "$SERVICE: Unrecognized service" > } > > if [ $# -eq 0 ]; then >@@ -69,7 +89,11 @@ case "$1" in > shift > check_service > cd / || exit >- "$SERVICEDIR/$SERVICE" "$@" >- exit $? >+ if systemd_is_active; then >+ exec "$SYSTEMCTL" "$@" "$SERVICE.service" >+ else >+ exec "$SERVICEDIR/$SERVICE" "$@" >+ fi >+ exit > ;; > esac
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 24989
:
4781
|
4830
|
4832
| 4836