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.