/[smeserver]/rpms/e-smith-base/sme10/e-smith-base-5.8.0-bz9672.servicesystemd.patch
ViewVC logotype

Annotation of /rpms/e-smith-base/sme10/e-smith-base-5.8.0-bz9672.servicesystemd.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sat Jul 23 13:31:45 2016 UTC (8 years, 3 months ago) by unnilennium
Branch: MAIN
CVS Tags: e-smith-base-5_8_0-71_el7_sme, e-smith-base-5_8_0-67_el7_sme, e-smith-base-5_8_0-64_el7_sme, e-smith-base-5_8_0-69_el7_sme, e-smith-base-5_8_0-70_el7_sme, e-smith-base-5_8_0-60_el7_sme, e-smith-base-5_8_0-65_el7_sme, e-smith-base-5_8_0-39_el7_sme, e-smith-base-5_8_0-83_el7_sme, e-smith-base-5_8_0-96_el7_sme, e-smith-base-5_8_0-95_el7_sme, e-smith-base-5_8_0-34_el7_sme, e-smith-base-5_8_0-80_el7_sme, e-smith-base-5_8_0-85_el7_sme, e-smith-base-5_8_0-50_el7_sme, e-smith-base-5_8_0-81_el7_sme, e-smith-base-5_8_0-82_el7_sme, e-smith-base-5_8_0-88_el7_sme, e-smith-base-5_8_0-41_el7_sme, e-smith-base-5_8_0-38_el7_sme, e-smith-base-5_8_0-54_el7_sme, e-smith-base-5_8_0-99_el7_sme, e-smith-base-5_8_0-94_el7_sme, e-smith-base-5_8_0-98_el7_sme, e-smith-base-5_8_0-97_el7_sme, e-smith-base-5_8_0-92_el7_sme, e-smith-base-5_8_0-28_el7_sme, e-smith-base-5_8_0-29_el7_sme, e-smith-base-5_8_0-75_el7_sme, e-smith-base-5_8_0-78_el7_sme, e-smith-base-5_8_0-37_el7_sme, e-smith-base-5_8_0-90_el7_sme, e-smith-base-5_8_0-35_el7_sme, e-smith-base-5_8_0-93_el7_sme, e-smith-base-5_8_0-55_el7_sme, e-smith-base-5_8_0-61_el7_sme, e-smith-base-5_8_0-52_el7_sme, e-smith-base-5_8_0-46_el7_sme, e-smith-base-5_8_0-62_el7_sme, e-smith-base-5_8_0-74_el7_sme, e-smith-base-5_8_0-77_el7_sme, e-smith-base-5_8_0-36_el7_sme, e-smith-base-5_8_0-63_el7_sme, e-smith-base-5_8_0-73_el7_sme, e-smith-base-5_8_0-76_el7_sme, e-smith-base-5_8_0-79_el7_sme, e-smith-base-5_8_0-30_el7_sme, e-smith-base-5_8_0-91_el7_sme, e-smith-base-5_8_0-58_el7_sme, e-smith-base-5_8_0-32_el7_sme, e-smith-base-5_8_0-86_el7_sme, e-smith-base-5_8_0-47_el7_sme, e-smith-base-5_8_0-31_el7_sme, e-smith-base-5_8_0-59_el7_sme, e-smith-base-5_8_0-87_el7_sme, e-smith-base-5_8_0-53_el7_sme, e-smith-base-5_8_0-44_el7_sme, e-smith-base-5_8_0-43_el7_sme, e-smith-base-5_8_0-40_el7_sme, e-smith-base-5_8_0-49_el7_sme, e-smith-base-5_8_0-48_el7_sme, e-smith-base-5_8_0-33_el7_sme, e-smith-base-5_8_0-66_el7_sme, e-smith-base-5_8_0-27_el7_sme, e-smith-base-5_8_0-68_el7_sme, e-smith-base-5_8_0-45_el7_sme, e-smith-base-5_8_0-42_el7_sme, e-smith-base-5_8_0-72_el7_sme, e-smith-base-5_8_0-84_el7_sme, e-smith-base-5_8_0-89_el7_sme, e-smith-base-5_8_0-51_el7_sme
* Sat Jul 23 2016 Jean-Philipe Pialasse <tests@pialasse.com> 5.8.0-27.sme
- adapt e-smith service command to systemd [SME: 9672]

1 unnilennium 1.1 diff -up e-smith-base-5.8.0/root/sbin/e-smith/service.bz9672.servicesystemd e-smith-base-5.8.0/root/sbin/e-smith/service
2     --- e-smith-base-5.8.0/root/sbin/e-smith/service.bz9672.servicesystemd 2016-02-04 18:14:13.000000000 -0500
3     +++ e-smith-base-5.8.0/root/sbin/e-smith/service 2016-07-23 09:28:59.034000000 -0400
4     @@ -1,13 +1,53 @@
5     #! /bin/sh
6     +# prevent initscript to use systemctl
7     +export SYSTEMCTL_SKIP_REDIRECT=1
8     +. /etc/rc.d/init.d/functions
9    
10     -runlevel=$(runlevel | cut -d" " -f2)
11     +# what is our current runlevel
12     +runlevel=$(systemctl get-default)
13     +SERVICE=$1
14     +USAGE="Usage: service SERVICENAME [ACTION]"
15    
16     -if [ "$runlevel" = "4" ]
17     +#if no servicename is provided return usage
18     +if [[ "${SERVICE}" == "" ]]
19     +then
20     + echo ${USAGE} >&2
21     + exit
22     +fi
23     +
24     +if [ "$runlevel" = "multi-user.target" ]
25     then
26     if ls /etc/rc7.d/S??$1 >/dev/null 2>/dev/null
27     then
28     script=$(ls /etc/rc7.d/S??$1 | head -1)
29     exec $script $2
30     +
31     + elif ls /usr/lib/systemd/system/${SERVICE}.service >/dev/null 2>/dev/null || ls /etc/systemd/system/${SERVICE}.service >/dev/null 2>/dev/null
32     + then
33     + if [[ "$2" == "" ]] ; then
34     + echo "'$1' requires an action" 1>&2
35     + echo ${USAGE} >&2
36     + exit
37     + elif [[ $2 == "status" ]] ; then
38     + exec /bin/systemctl status -n0 ${SERVICE}
39     + exit
40     + elif [[ $2 == "start" ]] ; then
41     + echo -n "Starting ${SERVICE}" 2>/dev/null
42     + elif [[ $2 == "stop" ]] ; then
43     + echo -n "Stopping ${SERVICE}" 2>/dev/null
44     + elif [[ $2 == "restart" ]] ; then
45     + echo -n "Restarting ${SERVICE}" 2>/dev/null
46     + else
47     + echo -n "Sending $2 signal to ${SERVICE}" 2>/dev/null
48     + fi
49     + /bin/systemctl $2 ${SERVICE}.service> /dev/null
50     + if [ $? -ne 0 ]; then
51     + echo_failure
52     + else
53     + echo_success
54     + fi
55     + echo
56     + exit
57     fi
58    
59     echo "'$1' is not a valid service name" 1>&2

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed