hwoarang 14/06/07 11:29:32 Modified: init.d.webmin gentoo-setup Added: webmin.service Log: Version bump. Fixes bug #511624 thanks to PhobosK <[email protected]> and Pacho Ramos <[email protected]> (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 09BF4F54C2BA7F3C!)
Revision Changes Path 1.12 app-admin/webmin/files/init.d.webmin file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/init.d.webmin?rev=1.12&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/init.d.webmin?rev=1.12&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/init.d.webmin?r1=1.11&r2=1.12 Index: init.d.webmin =================================================================== RCS file: /var/cvsroot/gentoo-x86/app-admin/webmin/files/init.d.webmin,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- init.d.webmin 9 Jul 2012 18:12:47 -0000 1.11 +++ init.d.webmin 7 Jun 2014 11:29:32 -0000 1.12 @@ -1,7 +1,7 @@ #!/sbin/runscript -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/files/init.d.webmin,v 1.11 2012/07/09 18:12:47 hwoarang Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/files/init.d.webmin,v 1.12 2014/06/07 11:29:32 hwoarang Exp $ # We do not give a choice to user for configuring these 'cause it will mess up @@ -9,6 +9,7 @@ WEBMIN_EXE="%exe%" WEBMIN_PID="%pid%" WEBMIN_CONF="%conf%" +WEBMIN_CONFIG="%config%" extra_started_commands="reload" @@ -18,8 +19,8 @@ checkconfig() { # Check if Webmin setup has been done - if [ ! -f /etc/webmin/config ]; then - eerror "Error in Webmin's configuration. The '/etc/webmin/config' is not present." + if [ ! -f ${WEBMIN_CONFIG} ]; then + eerror "Error in Webmin's configuration. The ${WEBMIN_CONFIG} is not present." eerror "Please run 'emerge --config app-admin/webmin' to fix this." return 1 fi 1.3 app-admin/webmin/files/gentoo-setup file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/gentoo-setup?rev=1.3&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/gentoo-setup?rev=1.3&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/gentoo-setup?r1=1.2&r2=1.3 Index: gentoo-setup =================================================================== RCS file: /var/cvsroot/gentoo-x86/app-admin/webmin/files/gentoo-setup,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- gentoo-setup 6 Feb 2013 20:13:50 -0000 1.2 +++ gentoo-setup 7 Jun 2014 11:29:32 -0000 1.3 @@ -1,7 +1,7 @@ #!/bin/sh # gentoo-setup.sh # -# Version 1.1 +# Version 1.2 # # A modified original Webmin setup.sh script to comply with Gentoo specifics # @@ -193,6 +193,7 @@ # Create start, stop, restart and reload Gentoo compliant Webmin scripts # We use sys-apps/openrc functions which is already pulled by sys-apps/baselayout +# or systemctl if we run under systemd echo "Creating start and stop scripts.." rm -f $config_dir/{start,stop,restart,reload} @@ -201,7 +202,11 @@ #!/bin/sh if [ ! -f "${pidfile}" ]; then - rc-service --ifexists -- webmin start + if [[ -d /run/systemd/system ]] ; then + systemctl start webmin.service + else + rc-service --ifexists -- webmin start + fi fi END @@ -209,21 +214,33 @@ cat <<END >>"$config_dir/stop" #!/bin/sh -rc-service --ifexists -- webmin --ifstarted stop +if [[ -d /run/systemd/system ]] ; then + systemctl stop webmin.service +else + rc-service --ifexists -- webmin --ifstarted stop +fi END # The restart script in /etc/webmin (Gentoo compliant) cat <<END >>"$config_dir/restart" #!/bin/sh -rc-service --ifexists -- webmin --ifstarted restart +if [[ -d /run/systemd/system ]] ; then + systemctl try-restart webmin.service +else + rc-service --ifexists -- webmin --ifstarted restart +fi END # The reload script in /etc/webmin (Gentoo compliant) cat <<END >>"$config_dir/reload" #!/bin/sh -rc-service --ifexists -- webmin --ifstarted reload +if [[ -d /run/systemd/system ]] ; then + systemctl reload-or-try-restart webmin.service +else + rc-service --ifexists -- webmin --ifstarted reload +fi END chmod 755 $config_dir/{start,stop,restart,reload} 1.1 app-admin/webmin/files/webmin.service file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/webmin.service?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/files/webmin.service?rev=1.1&content-type=text/plain Index: webmin.service =================================================================== [Unit] Description=Webmin Administration Tool After=network.target remote-fs.target nss-lookup.target ConditionFileNotEmpty=%config% ConditionFileNotEmpty=%conf% [Service] RemainAfterExit=yes KillMode=mixed # Webmin is exiting with 1 on SIGTERM SuccessExitStatus=1 ExecStart=%exe% %conf% PIDFile=%pid% Environment="PERLLIB=%perllib%" LANG= ExecReload=/bin/kill -USR1 $MAINPID [Install] WantedBy=multi-user.target
