1 |
hwoarang 14/06/07 11:29:32 |
2 |
|
3 |
Modified: init.d.webmin gentoo-setup |
4 |
Added: webmin.service |
5 |
Log: |
6 |
Version bump. Fixes bug #511624 thanks to PhobosK <phobosk@××××××××.fm> and Pacho Ramos <pacho@g.o> |
7 |
|
8 |
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 09BF4F54C2BA7F3C!) |
9 |
|
10 |
Revision Changes Path |
11 |
1.12 app-admin/webmin/files/init.d.webmin |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/init.d.webmin?rev=1.12&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/init.d.webmin?rev=1.12&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/init.d.webmin?r1=1.11&r2=1.12 |
16 |
|
17 |
Index: init.d.webmin |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/app-admin/webmin/files/init.d.webmin,v |
20 |
retrieving revision 1.11 |
21 |
retrieving revision 1.12 |
22 |
diff -u -r1.11 -r1.12 |
23 |
--- init.d.webmin 9 Jul 2012 18:12:47 -0000 1.11 |
24 |
+++ init.d.webmin 7 Jun 2014 11:29:32 -0000 1.12 |
25 |
@@ -1,7 +1,7 @@ |
26 |
#!/sbin/runscript |
27 |
-# Copyright 1999-2012 Gentoo Foundation |
28 |
+# Copyright 1999-2014 Gentoo Foundation |
29 |
# Distributed under the terms of the GNU General Public License v2 |
30 |
-# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/files/init.d.webmin,v 1.11 2012/07/09 18:12:47 hwoarang Exp $ |
31 |
+# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/files/init.d.webmin,v 1.12 2014/06/07 11:29:32 hwoarang Exp $ |
32 |
|
33 |
|
34 |
# We do not give a choice to user for configuring these 'cause it will mess up |
35 |
@@ -9,6 +9,7 @@ |
36 |
WEBMIN_EXE="%exe%" |
37 |
WEBMIN_PID="%pid%" |
38 |
WEBMIN_CONF="%conf%" |
39 |
+WEBMIN_CONFIG="%config%" |
40 |
|
41 |
extra_started_commands="reload" |
42 |
|
43 |
@@ -18,8 +19,8 @@ |
44 |
|
45 |
checkconfig() { |
46 |
# Check if Webmin setup has been done |
47 |
- if [ ! -f /etc/webmin/config ]; then |
48 |
- eerror "Error in Webmin's configuration. The '/etc/webmin/config' is not present." |
49 |
+ if [ ! -f ${WEBMIN_CONFIG} ]; then |
50 |
+ eerror "Error in Webmin's configuration. The ${WEBMIN_CONFIG} is not present." |
51 |
eerror "Please run 'emerge --config app-admin/webmin' to fix this." |
52 |
return 1 |
53 |
fi |
54 |
|
55 |
|
56 |
|
57 |
1.3 app-admin/webmin/files/gentoo-setup |
58 |
|
59 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/gentoo-setup?rev=1.3&view=markup |
60 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/gentoo-setup?rev=1.3&content-type=text/plain |
61 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/gentoo-setup?r1=1.2&r2=1.3 |
62 |
|
63 |
Index: gentoo-setup |
64 |
=================================================================== |
65 |
RCS file: /var/cvsroot/gentoo-x86/app-admin/webmin/files/gentoo-setup,v |
66 |
retrieving revision 1.2 |
67 |
retrieving revision 1.3 |
68 |
diff -u -r1.2 -r1.3 |
69 |
--- gentoo-setup 6 Feb 2013 20:13:50 -0000 1.2 |
70 |
+++ gentoo-setup 7 Jun 2014 11:29:32 -0000 1.3 |
71 |
@@ -1,7 +1,7 @@ |
72 |
#!/bin/sh |
73 |
# gentoo-setup.sh |
74 |
# |
75 |
-# Version 1.1 |
76 |
+# Version 1.2 |
77 |
# |
78 |
# A modified original Webmin setup.sh script to comply with Gentoo specifics |
79 |
# |
80 |
@@ -193,6 +193,7 @@ |
81 |
|
82 |
# Create start, stop, restart and reload Gentoo compliant Webmin scripts |
83 |
# We use sys-apps/openrc functions which is already pulled by sys-apps/baselayout |
84 |
+# or systemctl if we run under systemd |
85 |
echo "Creating start and stop scripts.." |
86 |
rm -f $config_dir/{start,stop,restart,reload} |
87 |
|
88 |
@@ -201,7 +202,11 @@ |
89 |
#!/bin/sh |
90 |
|
91 |
if [ ! -f "${pidfile}" ]; then |
92 |
- rc-service --ifexists -- webmin start |
93 |
+ if [[ -d /run/systemd/system ]] ; then |
94 |
+ systemctl start webmin.service |
95 |
+ else |
96 |
+ rc-service --ifexists -- webmin start |
97 |
+ fi |
98 |
fi |
99 |
END |
100 |
|
101 |
@@ -209,21 +214,33 @@ |
102 |
cat <<END >>"$config_dir/stop" |
103 |
#!/bin/sh |
104 |
|
105 |
-rc-service --ifexists -- webmin --ifstarted stop |
106 |
+if [[ -d /run/systemd/system ]] ; then |
107 |
+ systemctl stop webmin.service |
108 |
+else |
109 |
+ rc-service --ifexists -- webmin --ifstarted stop |
110 |
+fi |
111 |
END |
112 |
|
113 |
# The restart script in /etc/webmin (Gentoo compliant) |
114 |
cat <<END >>"$config_dir/restart" |
115 |
#!/bin/sh |
116 |
|
117 |
-rc-service --ifexists -- webmin --ifstarted restart |
118 |
+if [[ -d /run/systemd/system ]] ; then |
119 |
+ systemctl try-restart webmin.service |
120 |
+else |
121 |
+ rc-service --ifexists -- webmin --ifstarted restart |
122 |
+fi |
123 |
END |
124 |
|
125 |
# The reload script in /etc/webmin (Gentoo compliant) |
126 |
cat <<END >>"$config_dir/reload" |
127 |
#!/bin/sh |
128 |
|
129 |
-rc-service --ifexists -- webmin --ifstarted reload |
130 |
+if [[ -d /run/systemd/system ]] ; then |
131 |
+ systemctl reload-or-try-restart webmin.service |
132 |
+else |
133 |
+ rc-service --ifexists -- webmin --ifstarted reload |
134 |
+fi |
135 |
END |
136 |
|
137 |
chmod 755 $config_dir/{start,stop,restart,reload} |
138 |
|
139 |
|
140 |
|
141 |
1.1 app-admin/webmin/files/webmin.service |
142 |
|
143 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/webmin.service?rev=1.1&view=markup |
144 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/webmin.service?rev=1.1&content-type=text/plain |
145 |
|
146 |
Index: webmin.service |
147 |
=================================================================== |
148 |
[Unit] |
149 |
Description=Webmin Administration Tool |
150 |
After=network.target remote-fs.target nss-lookup.target |
151 |
ConditionFileNotEmpty=%config% |
152 |
ConditionFileNotEmpty=%conf% |
153 |
|
154 |
[Service] |
155 |
RemainAfterExit=yes |
156 |
KillMode=mixed |
157 |
# Webmin is exiting with 1 on SIGTERM |
158 |
SuccessExitStatus=1 |
159 |
ExecStart=%exe% %conf% |
160 |
PIDFile=%pid% |
161 |
Environment="PERLLIB=%perllib%" LANG= |
162 |
ExecReload=/bin/kill -USR1 $MAINPID |
163 |
|
164 |
[Install] |
165 |
WantedBy=multi-user.target |