How can I disable the lighttpd daemon on startup in Ubuntu
Asked Answered
N

2

17

I'm setting up lighty according to this guide, and I don't really have an use for the lighttpd daemon that was installed (this is the one that resides in /etc/init.d/lighttpd). I don't want a webserver running all the time, except when I'm working. I want to just call lighttpd -Df lighttpd.conf when I need to.

How can I disable this ?

Nilson answered 27/2, 2013 at 18:51 Comment(0)
E
24

You can disable lighttpd on boot with the following command.

sudo update-rc.d -f lighttpd remove

This is a script which will remove the lighttpd start up script from the following locations:

/etc/rc0.d
/etc/rc1.d
/etc/rc2.d
/etc/rc3.d
/etc/rc4.d
/etc/rc5.d
/etc/rc6.d
/etc/rcS.d

To re-enable lighttpd you can run the following command:

sudo update-rc.d lighttpd defaults

Hope that helps

Ex answered 7/3, 2013 at 12:9 Comment(2)
And what would be the command if you want to put it back into the start sequence? TIAHurd
Updated the answer with how to add it back again.Ex
H
5

Our with systemd:

prompt$ sudo systemctl disable lighttpd

You may also want to

prompt$ sudo systemctl stop lighttpd

as disable does not stop any running server.

systemd pretty much falls back to SysV handling and runs a script that does what Oliver mentioned in his answer (as far as I know)

Synchronizing state of lighttpd.service with SysV init with
   /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install disable lighttpd

Eventually evaluating

$CHROOT /usr/sbin/update-rc.d "$NAME" defaults
$CHROOT /usr/sbin/update-rc.d "$NAME" disable

(On a Fedora box when looking)

Hillis answered 31/8, 2017 at 1:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.