How to repair installation, accidentally deleted /sbin/initctl

9,752

Try re-installing Upstart:

sudo apt-get --reinstall install upstart

There is no way to recover lost binary otherwise. initctl unlike start, stop or restart is a separate executable and not a link to init itself.

If you do not have connectivity, see which version of Upstart package you have dpkg -l|grep upstart and download the package manually on another machine to a USB stick and reinstall from the stick. All dependencies are correct since you're just reinstalling the exact same version.

Share:
9,752

Related videos on Youtube

Spart
Author by

Spart

Updated on September 18, 2022

Comments

  • Spart
    Spart almost 2 years

    I'm running Ubuntu 12.04 on a VirtualBox. I was trying to create a central log server with rsyslog. At some point I made changes to the conf file and tried to restart rsyslog, but started getting the following error:

    Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused

    Following what this question suggested http://ubuntuforums.org/showthread.php?t=1997229

    I issued the following commands

    dpkg-divert --local --rename --add /sbin/initctl
    ln -s /bin/true /sbin/initctl
    

    However this did not resolve the issue as running the following was not actually restarting rsyslog.

    service rsyslog restart

    So I tried to undo the initial commands by doing

    dpkg-divert --local --remove /sbin/initctl
    rm /sbin/initctl
    

    However deleting initctl started causing other issues. So I rebooted the machine, and the machine wouldn't boot normally. I went into recovery mode, and before displaying the recovery menu it printed /proc/self/fd/9: 5: /proc/self/fd/9: initctl: not found.

    Does anyone know how I can restore the initctl?

    Edit: I also booted the VM with the iso image for 12.04 and went to recovery menu, however there does not seem to be a way of restoring the deleted files.