Results 1 to 10 of 12

Thread: [Lucid] How to disable services in upstart?

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Beans
    7

    Question [Lucid] How to disable services in upstart?

    Hi,

    I recently discovered upstart is launching sshd on my machine even though I disabled it with `sudo update-rc.d -f ssh remove`. I tried to find a way to prevent upstart from launching ssh by default, but the best I can think of is removing /etc/init/ssh.conf (I just uninstalled openssh-server).

    I'd like to disable it without doing this, though. This would make it easier to enable sshd when I need it.

    Anyone know what the best practice for this is?

    Thanks!

  2. #2
    Join Date
    Sep 2009
    Location
    Argentina
    Beans
    318
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: [Lucid] How to disable services in upstart?

    Mmmm how about pressing alt+F2 and then running gnome-session-properties?
    It has a list of apps run when starting a session...

  3. #3
    Join Date
    Apr 2007
    Beans
    7

    Re: [Lucid] How to disable services in upstart?

    Quote Originally Posted by gadolinio View Post
    Mmmm how about pressing alt+F2 and then running gnome-session-properties?
    It has a list of apps run when starting a session...
    As you say, those are apps launched in my session. sshd is not there; it's launched when the machine comes up, before any session is even started.

  4. #4
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: [Lucid] How to disable services in upstart?


  5. #5
    Join Date
    Apr 2007
    Beans
    7

    Re: [Lucid] How to disable services in upstart?

    Quote Originally Posted by dino99 View Post
    Thanks for the link. I couldn't find anything relevant to upstart/sshd though. Could you point it out please?

  6. #6
    Join Date
    Aug 2008
    Location
    Hmm..$whereis?
    Beans
    136
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [Lucid] How to disable services in upstart?

    I have always done this using the following method and it works. But I am not 100% sure this is the best way to do so.

    Code:
    $cd /etc/init
    Then rename the .conf file of the service that you want to disable to something else. I do it like this.

    Code:
    $sudo mv sshd.conf sshd.conf.off
    Now reboot and check using the following command;

    Code:
    sudo netstat -ltunp
    sshd should not be listed in there.
    Debian 6.0.1(Squeeze)/64bit
    **************************
    MSI K9AGM4-L | AMD Athlon64 X2 4000+ | 2x1GB DDR2 800MHZ(Transcend) | ATI Radeon Xpress 1250(Onboard) | Seagate 250GB SATA II | Acer AL1916W

  7. #7
    Join Date
    May 2005
    Beans
    17

    Re: [Lucid] How to disable services in upstart?

    I have made a little post about the different ways that services are enabled/disabled in Ubuntu. The reason was that I ran into 3 different ways of launching the same program within the past 3 versions of Ubuntu Not to say that everything is that bad, and Upstart is certainly a powerful new player. But for now, it can be quite confusing to get rid of a service

    http://overtag.dk/wordpress/2011/02/...-ubuntu-10-10/

  8. #8
    Join Date
    Dec 2008
    Location
    Kent, UK
    Beans
    26
    Distro
    Ubuntu

    Re: [Lucid] How to disable services in upstart?

    Quote Originally Posted by Ben Jao Ming View Post
    I have made a little post about the different ways that services are enabled/disabled in Ubuntu. The reason was that I ran into 3 different ways of launching the same program within the past 3 versions of Ubuntu Not to say that everything is that bad, and Upstart is certainly a powerful new player. But for now, it can be quite confusing to get rid of a service

    http://overtag.dk/wordpress/2011/02/...-ubuntu-10-10/
    Hi Ben,
    great hints, thanks a lot. Just one note: I think the "stop on" upstart section should never be commented out.

    The reason is you still might start the daemon explicitly (manually) and then during shutdown it might not be stopped at the appropriate moment (consequentially correct according to the design) which might result in unpredictable issues (slower shutdown is the least harmful, data loss/corruption if e.g. a database gets a sigkill termination at the end of shutdown, or even a system freeze during shutdown caused by a deadlock situation).

    Cheers,
    CePal

  9. #9
    Join Date
    Nov 2010
    Beans
    271
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: [Lucid] How to disable services in upstart?

    update-rc.d is the program to be used to install, remove and disable init scripts.
    to disable a service say, the pure-ftp deamon (pure-ftpd) at start-up, use
    Code:
    update-rc.d -f pure-ftpd remove
    for more info see the man page of update-rc.d

  10. #10
    Join Date
    Aug 2007
    Beans
    16

    Re: [Lucid] How to disable services in upstart?

    Quote Originally Posted by debd View Post
    update-rc.d is the program to be used to install, remove and disable init scripts.
    to disable a service say, the pure-ftp deamon (pure-ftpd) at start-up, use
    Code:
    update-rc.d -f pure-ftpd remove
    for more info see the man page of update-rc.d
    Uh, no. update-rc.d works for /etc/init.d services, but not for upstart (/etc/init) services. I guess you didn't read the thread before posting?

    The problem is that to disable upstart services, you HAVE TO either delete or modify /etc/init/job.conf. This causes problems when upgrading the corresponding package.

Tags for this Thread

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
  •