Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 511624 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/local/portage/app-admin/webmin/webmin-1.680.ebuild (-13 / +44 lines)
Lines 1-10 Link Here
1
# Copyright 1999-2014 Gentoo Foundation
1
# Copyright 1999-2014 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/webmin-1.680.ebuild,v 1.1 2014/05/01 16:30:09 hwoarang Exp $
3
# $Header: $
4
4
5
EAPI="3"
5
EAPI="5"
6
6
7
inherit eutils pam ssl-cert
7
inherit eutils pam ssl-cert systemd
8
8
9
DESCRIPTION="A web-based Unix systems administration interface"
9
DESCRIPTION="A web-based Unix systems administration interface"
10
HOMEPAGE="http://www.webmin.com/"
10
HOMEPAGE="http://www.webmin.com/"
Lines 114-123 Link Here
114
		-e "s:%exe%:${EROOT}usr/libexec/webmin/miniserv.pl:" \
114
		-e "s:%exe%:${EROOT}usr/libexec/webmin/miniserv.pl:" \
115
		-e "s:%pid%:${EROOT}var/run/webmin.pid:" \
115
		-e "s:%pid%:${EROOT}var/run/webmin.pid:" \
116
		-e "s:%conf%:${EROOT}etc/webmin/miniserv.conf:" \
116
		-e "s:%conf%:${EROOT}etc/webmin/miniserv.conf:" \
117
		-e "s:%config%:${EROOT}etc/webmin/config:" \
117
		-e "s:%perllib%:${EROOT}usr/libexec/webmin:" \
118
		-e "s:%perllib%:${EROOT}usr/libexec/webmin:" \
118
		"${ED}etc/init.d/webmin" \
119
		"${ED}etc/init.d/webmin" \
119
		|| die "Failed to patch the webmin init file"
120
		|| die "Failed to patch the webmin init file"
120
121
122
	# Create the systemd service file and put the neccessary variables there
123
	systemd_newunit "${FILESDIR}"/webmin.service webmin.service
124
	sed -i \
125
		-e "s:%exe%:${EROOT}usr/libexec/webmin/miniserv.pl:" \
126
		-e "s:%pid%:${EROOT}var/run/webmin.pid:" \
127
		-e "s:%conf%:${EROOT}etc/webmin/miniserv.conf:" \
128
		-e "s:%config%:${EROOT}etc/webmin/config:" \
129
		-e "s:%perllib%:${EROOT}usr/libexec/webmin:" \
130
		"${ED}$(_systemd_get_unitdir)/webmin.service" \
131
		|| die "Failed to patch the webmin systemd service file"
132
121
	# Setup pam
133
	# Setup pam
122
	pamd_mimic system-auth webmin auth account session
134
	pamd_mimic system-auth webmin auth account session
123
135
Lines 130-136 Link Here
130
pkg_preinst() {
142
pkg_preinst() {
131
	# First stop service if running so Webmin to not messup our config
143
	# First stop service if running so Webmin to not messup our config
132
	ebegin "Stopping any running Webmin instance prior merging"
144
	ebegin "Stopping any running Webmin instance prior merging"
133
	rc-service --ifexists -- webmin --ifstarted stop
145
	if systemd_is_booted ; then
146
		systemctl stop webmin.service 2>/dev/null
147
	else
148
		rc-service --ifexists -- webmin --ifstarted stop
149
	fi
134
	eend $?
150
	eend $?
135
}
151
}
136
152
Lines 147-153 Link Here
147
	ewarn "To avoid problems, please before using any module, look at its configuration options first."
163
	ewarn "To avoid problems, please before using any module, look at its configuration options first."
148
	ewarn "(Usually there is a link at top in the right pane of Webmin for configuring the module.)"
164
	ewarn "(Usually there is a link at top in the right pane of Webmin for configuring the module.)"
149
	ewarn
165
	ewarn
150
	elog "- To make Webmin start at boot time, run: 'rc-update add webmin default'"
166
	if systemd_is_booted ; then
167
		elog "- To make Webmin start at boot time, run: 'systemctl enable webmin.service'"
168
	else
169
		elog "- To make Webmin start at boot time, run: 'rc-update add webmin default'"
170
	fi
151
	elog "- The default URL to connect to Webmin is: https://localhost:10000"
171
	elog "- The default URL to connect to Webmin is: https://localhost:10000"
152
	elog "- The default user that can login is: root"
172
	elog "- The default user that can login is: root"
153
	elog "- To reconfigure Webmin in case of problems run 'emerge --config app-admin/webmin'"
173
	elog "- To reconfigure Webmin in case of problems run 'emerge --config app-admin/webmin'"
Lines 156-178 Link Here
156
pkg_prerm() {
176
pkg_prerm() {
157
	# First stop service if running - we do not want Webmin to mess up config
177
	# First stop service if running - we do not want Webmin to mess up config
158
	ebegin "Stopping any running Webmin instance prior unmerging"
178
	ebegin "Stopping any running Webmin instance prior unmerging"
159
	rc-service --ifexists -- webmin --ifstarted stop
179
	if systemd_is_booted ; then
180
		systemctl stop webmin.service 2>/dev/null
181
	else
182
		rc-service --ifexists -- webmin --ifstarted stop
183
	fi
160
	eend $?
184
	eend $?
161
}
185
}
162
186
163
pkg_postrm() {
187
pkg_postrm() {
164
	ewarn
188
	# If removing webmin completely, remind the user for the Webmin's own cron jobs.
165
	ewarn "You have uninstalled Webmin, so have in mind that all cron jobs scheduled"
189
	if [[ ! ${REPLACED_BY_VERSION} ]]; then
166
	ewarn "by Webmin for its own modules, are left active and they will fail when Webmin is missing."
190
		ewarn
167
	ewarn "To fix this just disable them if you intend to use Webmin again,"
191
		ewarn "You have uninstalled Webmin, so have in mind that all cron jobs scheduled"
168
	ewarn "OR delete them if not."
192
		ewarn "by Webmin for its own modules, are left active and they will fail when Webmin is missing."
169
	ewarn
193
		ewarn "To fix this just disable them if you intend to use Webmin again,"
194
		ewarn "OR delete them if not."
195
		ewarn
196
	fi
170
}
197
}
171
198
172
pkg_config(){
199
pkg_config(){
173
	# First stop service if running
200
	# First stop service if running
174
	ebegin "Stopping any running Webmin instance"
201
	ebegin "Stopping any running Webmin instance"
175
	rc-service --ifexists -- webmin --ifstarted stop
202
	if systemd_is_booted ; then
203
		systemctl stop webmin.service 2>/dev/null
204
	else
205
		rc-service --ifexists -- webmin --ifstarted stop
206
	fi
176
	eend $?
207
	eend $?
177
208
178
	# Next set the default reset variable to 'none'
209
	# Next set the default reset variable to 'none'

Return to bug 511624