avoid starting a program during reboot
Hi, I do not want to start some program, such as apache server, during reboot, shall I simply remove it from /etc/init.d/ ? haha ... is it a bit brutal? or lack elegance? THanks with best regards, -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/522da000.3090...@gmail.com
Re: avoid starting a program during reboot
Hi you can use chkconfig ( apt-get install chkconfig) command to disable services on boot root@do1:~/.SpiderOak# chkconfig --list apache2 apache2 0:off 1:off 2:on 3:on 4:on 5:on 6:off root@do1:~/.SpiderOak# chkconfig apache2 off root@do1:~/.SpiderOak# chkconfig --list apache2 apache2 0:off 1:off 2:off 3:off 4:off 5:off 6:off root@do1:~/.SpiderOak# chkconfig apache2 on root@do1:~/.SpiderOak# chkconfig --list apache2 apache2 0:off 1:off 2:on 3:on 4:on 5:on 6:off Hope it helps Best regards -- Juan Sierra Pons j...@elsotanillo.net Linux User Registered: #257202 http://www.elsotanillo.net GPG key = 0xA110F4FE Key Fingerprint = DF53 7415 0936 244E 9B00 6E66 E934 3406 A110 F4FE -- 2013/9/9 lina lina.lastn...@gmail.com Hi, I do not want to start some program, such as apache server, during reboot, shall I simply remove it from /etc/init.d/ ? haha ... is it a bit brutal? or lack elegance? THanks with best regards, -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/522da000.3090...@gmail.com
Re: avoid starting a program during reboot
On 9/9/13 1:16 PM, lina wrote: Hi, I do not want to start some program, such as apache server, during reboot, shall I simply remove it from /etc/init.d/ ? haha ... is it a bit brutal? or lack elegance? THanks with best regards, Your default runlevel is 2, so you would look in /etc/rc2.d/ for the script to remove, actually it is a symlink there. If you want to do it officially, you could use 'update-rc.d' update-rc.d -f apache2 remove That should get it from all the rc?.d directories. Regards, /Lars -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/522da1e2.2050...@gmail.com
Re: avoid starting a program during reboot
update-rc.d -f apache2 remove That should get it from all the rc?.d directories. Gorgeous, thanks both of you. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/522da578.1060...@gmail.com
Re: avoid starting a program during reboot
On 9/9/13 1:39 PM, lina wrote: update-rc.d -f apache2 remove That should get it from all the rc?.d directories. Gorgeous, thanks both of you. An after thought: If you want it to stick permanently even after upgrades you will also have to re-populate the directories with stop scripts: update-rc.d apache2 stop 17 0 1 2 3 4 5 6 . Regards, /Lars -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/522da73d.5080...@gmail.com
Re: avoid starting a program during reboot
On Monday 09,September,2013 06:47 PM, Lars Noodén wrote: On 9/9/13 1:39 PM, lina wrote: update-rc.d -f apache2 remove That should get it from all the rc?.d directories. Gorgeous, thanks both of you. An after thought: If you want it to stick permanently even after upgrades you will also have to re-populate the directories with stop scripts: update-rc.d apache2 stop 17 0 1 2 3 4 5 6 . I notice apach2 still in /etc/init.d/, it is good, so I can restart it when I need it (only occasionally). BTW, how do I know, my runlevel is 2? $ nice 0 and what does 17 stand for? # ls rc rc0.d/rc1.d/rc2.d/rc3.d/rc4.d/rc5.d/rc6.d/ rc.local rcS.d/ THanks again with best regards, Regards, /Lars -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/522da836.7000...@gmail.com
Re: avoid starting a program during reboot
On 9/9/13 1:51 PM, lina wrote: I notice apach2 still in /etc/init.d/, it is good, so I can restart it when I need it (only occasionally). Yes. You can use that script to start (and then stop) the service on demand. /etc/init.d/apache2 start That directory is where the template script resides. You can restore the defaults later if you need to. update-rc.d apache2 defaults Or use some custom selection of sequence and runlevels. The defaults are fished out of the template script and you can view them there in the script. BTW, how do I know, my runlevel is 2? $ nice 0 runlevel is kind of an anachronism. You can find it by running 'runlevel' and you can change it by running 'telinit' It is/was used to have different constellations of services running, effectively putting the machine into different modes of operation. and what does 17 stand for? 17 is the sequence in which the script is executed. It can be anything 00 - 99. Look at the numbers of the other scripts in /etc/rc2.d/ The manual pages for update-rc.d, runlevel, and telinit cover a lot of details and some background. The whole mess is referred to as SystemV init scripts. Regards, /Lars -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/522daa12.7070...@gmail.com
Re: avoid starting a program during reboot
On Mon 09 Sep 2013 at 13:47:25 +0300, Lars Noodén wrote: On 9/9/13 1:39 PM, lina wrote: update-rc.d -f apache2 remove That should get it from all the rc?.d directories. Gorgeous, thanks both of you. An after thought: If you want it to stick permanently even after upgrades you will also have to re-populate the directories with stop scripts: update-rc.d apache2 stop 17 0 1 2 3 4 5 6 . Nobody appears to be taking any notice of what update-rc.dD(8) says: A common system administration error is to delete the links with the thought that this will disable the service, i.e., that this will prevent the service from being started. However, if all links have been deleted then the next time the package is upgraded, the package's postinst script will run update-rc.d again and this will reinstall links at their factory default locations. The correct way to disable services is to configure the service as stopped in all runlevels in which it is started by default. In the System V init system this means renaming the service's symbolic links from S to K. So update-rc.d apache2 disable should be used. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20130909142219.ga26...@copernicus.demon.co.uk
Re: avoid starting a program during reboot
On 09.09.2013 17:22, Brian wrote: On Mon 09 Sep 2013 at 13:47:25 +0300, Lars Noodén wrote: On 9/9/13 1:39 PM, lina wrote: update-rc.d -f apache2 remove That should get it from all the rc?.d directories. Gorgeous, thanks both of you. An after thought: If you want it to stick permanently even after upgrades you will also have to re-populate the directories with stop scripts: update-rc.d apache2 stop 17 0 1 2 3 4 5 6 . Nobody appears to be taking any notice of what update-rc.dD(8) says: A common system administration error is to delete the links with the thought that this will disable the service, i.e., that this will prevent the service from being started. However, if all links have been deleted then the next time the package is upgraded, the package's postinst script will run update-rc.d again and this will reinstall links at their factory default locations. The correct way to disable services is to configure the service as stopped in all runlevels in which it is started by default. In the System V init system this means renaming the service's symbolic links from S to K. So update-rc.d apache2 disable should be used. Thanks. R egards, /Lars -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/522ddaa5.3010...@gmail.com
Re: avoid starting a program during reboot
On Mon, Sep 9, 2013 at 6:16 AM, lina lina.lastn...@gmail.com wrote: I do not want to start some program, such as apache server, during reboot, shall I simply remove it from /etc/init.d/ ? haha ... is it a bit brutal? or lack elegance? update-rc.d init.d_script_name disable will do this properly. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/CAOdo=swsmvjw0eo1cufc+lk4cx3sgdthj1o1x0hbcwqbsu8...@mail.gmail.com