I've added a script called kafka, which runs two never ending services (the kafka server and the zookeeper)

I've added this script into /etc/init.d And also added to the profile on the

nano ~/.profile

Now after I turn on my Ubuntu, and write my password, the screen looks like it's locked, waiting for the script to end.

But now I can't access anything on my virtual machine.


If there any way to fix this and delete the script I've added?

It stays like this for ever...


1 Answer 1


Press CTRL+ALT+F1 to access tty1. Once in tty1, login with your username and password. Then you can use Nano remove the offending lines. After you have removed them, do:

sudo shutdown -r now

P.S. Your problem is probably that you didn't put & after the command to run the script.

  • Thanks! That's exactly what I want. By the way, I've put && between command. It should be just one &?
    – waas1919
    Sep 27, 2017 at 13:33
  • 1
    @waas1919 && means to run the following command if the first completed successfully. A single & means to run the command in the background, which is what you want, otherwise it hangs the userspace startup. So for example, what you want is ./script.sh & Sep 27, 2017 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.