Ubuntu – Force stop upstart job

Ubuntuupstart

I accidentally deleted some upstart job conf (in /etc/init/). Unfortunately I didn't set any respawn limit, and those jobs are now unstoppable.

I searched online but didn't find any answers, hope I will have better luck here.
Regards
R

PS: I'm using ubuntu 12.04

Best Answer

Assuming you know what files you have deleted, you can:

  • restore them from a backup (you have backups, right?)
  • if you don't have a backup, you can locate the package that provides the file using either:

    # dpkg-query -S /path/to/file
    

    (if you still have the package installed; you should, you just deleted a file from it)

    # apt-file /path/to/file
    

    (if you don't have the packaged installed anymore, for whatever reason)

    You can also use the Ubuntu Packages Search web site.

  • Afterwards, when you know which package that file you deleted came from, you can just

    # aptitude reinstall package
    

    and the file will be there again and you will be able to stop your processes normaly.

Related Topic