0

i have a python script that does infinite loop on functions written, and i have added this to systemd as service so i want to run python script at background and control its from systemctl.

sudo vi /lib/systemd/system/dummy.service

[Unit]
Description=Dummy Service
After=multi-user.target
Conflicts=getty@tty1.service

[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/bin/dummy_service.py
StandardInput=tty-force

[Install]
WantedBy=multi-user.target

while configuring above service, i made a type error on the path of python script located, and since it's cant locate the file, systemctl status says dummmy.service failed to start.

and when i restarted RedHat Linux OS (VMware Virtual Machine), it failed to boot because there is problem in above service configuration. it is not able to open the specified file.

How to fix this Virtual Machine boot issue with service (not by just correcting mistake in service definition), So even if there is issue with path mentioned for python script, or if any issue in python scripting, it wont affect my server booting process.

Because i want to avoid getting my VM hanged due to any issues/bugs related python script/daemon service.

Please help.

thanks in advance.

Maria628
  • 101
  • It looks to me that the problem is with `Conflicts=getty@tty1.service`, which means the console was disabled as you enabled this service, so now you have no console enabled anymore... Is that the issue? To recover, you might need to boot into rescue or recovery/emergency mode and re-enable the console. Depending on your boot loader, you might have an option for that, or you might need to enter the boot loader command-line to add kernel command-line arguments and boot into a recovery mode. Look that up, you'll find answers on how to do that. – filbranden Mar 15 '20 at 23:32
  • Hi, Since it's just a new VM i was not bothered of recovering the OS.. I am bothered of my decision to pick this idea of daemon service without having proper knowledge on it. i cant take risk of putting my application in daemon service, which may cause OS hung situation. – Maria628 Mar 17 '20 at 03:24
  • So i wanted to ask if there is a way to avoid getting my VM OS hanged due to any issues/bugs related python script/daemon service..? – Maria628 Mar 17 '20 at 03:26
  • Just like "Conflicts=getty@tty1.service" created a mess,, i dont know if my python script having a infinite loop creates in any issue and hung the OS daemon again.. i dont know. – Maria628 Mar 17 '20 at 03:27

0 Answers0