1

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

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
rmonjo
  • 231
  • 2
  • 4
  • 12

2 Answers2

1

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.

dawud
  • 15,096
  • 3
  • 42
  • 61
1

I've tried to reproduce, and as long as the service is running, upstart will know how to stop it with stop $svcname. You can see if upstart knows about it with initctl list | grep $svcname. If upstart doesn't list it, then you should be able to kill it with kill. Make sure the service doesn't have its own watchdog/parent process, though, in which case you would have to kill that instead.

bonsaiviking
  • 4,420
  • 17
  • 26
  • 1
    Thx for your answer. I see my jobs in `initctl list`, but when I `sudo stop myjob`, it ends up telling me: `my-job start/running, process 23213`. – rmonjo Apr 02 '14 at 08:27