Results 1 to 6 of 6

Thread: Enabling/Disabling services autostart

  1. #1
    Join Date
    Aug 2010
    Location
    Cullinan , Gauteng
    Beans
    436
    Distro
    Ubuntu 12.04 Precise Pangolin

    Enabling/Disabling services autostart

    Lo All ,

    How do you enable/disable the autostart of services. For example let's say I know I'm not gonna use apache and mysql for a while and don't want it to autostart anymore how do I disable it ?

    And then once it is needed again how do you enable the autostart again ?

    Thanx
    I5 3ghz , 16gig RAM, Nvidia Geforce GT610 1gig

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Enabling/Disabling services autostart

    I'd just remove the execute permission from the file /etc/init.d, but there are easier ways to do it.

    Like this one.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Enabling/Disabling services autostart

    I usually use,

    sudo update-rc.d <appname> disable

    but I've read this is frowned on now. For newer configs using Upstart I usually just rename the conf file eg.

    sudo mv /etc/init/<appname>.conf /etc/init/<appname>.conf.disabled

    since it only acts on the ones ending with .conf.

    Some services have a enable/disable option in a file in /etc/defaults/<appname>

    It would be nice if someday they finally get them all caught up to a standard.

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,617
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Enabling/Disabling services autostart

    This situation where some daemons use upstart and others use the older /etc/init.d system is really a pain. I've seen a number of requests like the OP's about enabling or disabling services, and unless you've used a particular program, you now simply have no idea which init method it uses. Upstart may be a fine idea, but it should never have been introduced piecemeal. The packagers should have left everything under the old system until there were working upstart modules for every program that comes by default with Ubuntu Server and probably even a few, like OpenVPN, that don't.

    That's one reason why I don't use Ubuntu Server on production deployments. "chkconfig" and "service" work consistently for all server daemons in RHEL/CentOS.

  5. #5
    Join Date
    Aug 2010
    Location
    Cullinan , Gauteng
    Beans
    436
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Enabling/Disabling services autostart

    Seems like this is a tricky one. I checked out my /etc/init and some servers (like samba for ex) doesn't even have a .conf file there.
    I5 3ghz , 16gig RAM, Nvidia Geforce GT610 1gig

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Enabling/Disabling services autostart

    Quote Originally Posted by BkkBonanza View Post
    I usually use,

    sudo update-rc.d <appname> disable

    but I've read this is frowned on now. For newer configs using Upstart I usually just rename the conf file eg.

    sudo mv /etc/init/<appname>.conf /etc/init/<appname>.conf.disabled

    since it only acts on the ones ending with .conf.

    Some services have a enable/disable option in a file in /etc/defaults/<appname>

    It would be nice if someday they finally get them all caught up to a standard.
    I checked /etc/init.d on my lucid server box and didn't see any *.conf files in /etc/init.d.

    Some were symlinks to /lib/init/upstart-job
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •