How to stop unwanted servrices during boot

Markus Hubig ubuntu at pot.ath.cx
Tue Nov 16 23:08:03 UTC 2004


On Wed, 17 Nov 2004, Christoph Georgi wrote:

> I think Neil'S suggestion is a pretty good compromise: is's as easy for 
> novice users as the chmod -x method but is more obvious when debugging 
> the system as using the 'ls' command clearly shows the disabled 
> services. I have to agree, that changing the init scrips can be a hassle 
> for novice uses and might mess up even more.

Yeah, I agree too. It's not that cool but it's ok ...

| $ ls /etc/rc*.d/*ppp 
| /etc/rc0.d/K86ppp  /etc/rc2.d/S14ppp  /etc/rc4.d/S14ppp  /etc/rc6.d/K86ppp
| /etc/rc1.d/K86ppp  /etc/rc3.d/S14ppp  /etc/rc5.d/S14ppp
|
| $ sudo rename 's#\/etc\/rc(.)\.d\/(K|S)(.*)#\/etc\/rc$1\.d/_$2$3#' /etc/rc*.d/*ppp
| 
| $ ls /etc/rc*.d/*ppp 
| /etc/rc0.d/_K86ppp  /etc/rc2.d/_S14ppp  /etc/rc4.d/_S14ppp /etc/rc6.d/_K86ppp
| /etc/rc1.d/_K86ppp  /etc/rc3.d/_S14ppp  /etc/rc5.d/_S14ppp

and back again

| $ sudo rename 's#\/etc\/rc(.)\.d\/_(K|S)(.*)#\/etc\/rc$1\.d/$2$3#' /etc/rc*.d/*ppp
| 
| $ ls /etc/rc*.d/*ppp
| /etc/rc0.d/K86ppp  /etc/rc2.d/S14ppp  /etc/rc4.d/S14ppp  /etc/rc6.d/K86ppp
| /etc/rc1.d/K86ppp  /etc/rc3.d/S14ppp  /etc/rc5.d/S14ppp

Hmm, just doing a "chmod -x /etc/init.d/ppp" IS easier ;-)

> Mangling the filename is certainly not a clean way to stop services from 
> starting up during boot (as chmod -x isn't), but I reckon that we have 
> to wait for the /etc/default/<options> stuff till a clean stop is possible?!

Yes! And ist quite easy to implement ...

| if [ -f /etc/default/$SERVICE ]; then
| 	. /etc/default/$SERVICE
| fi
|
| if [ ! $START_SERVICE = 'YES' ]; then
|	log_warning_msg "Don't starting $SERVICE it's disables in /etc/default/$SERVICE"
|	exit 0
| fi

   - Markus

-- 
"If it dies, it's biology.  If it blows up, it's chemistry,
and if it doesn't work, it's physics."
	- University bathroom graffito




More information about the ubuntu-users mailing list