0

I have a Google VM micro instance running Ubuntu 20.04. Last week on this VM, I set up a systemd service that runs a python script. I created the service file (say my_fancy_service.service) as /lib/systemd/system/my_fancy_service.service and inside this service file, it calls /usr/bin/python3 /usr/local/bin/my_fancy_service.py. Everything works fine as expected.

But today I came back to this server and the service file /lib/systemd/system/my_fancy_service.service is just gone. All my other files are there: my executable python scripts and all my log files in /var/log/my_fancy_service/*.log. But my service file disappeared. Obviously I don't want this: this service should be a perpetually running service.

Is there any reason why my service file would have disappeared? Is this some issue when the VM reboots or somehow gets recreated? What could have caused this and how do I prevent it?

Marc
  • 151
  • 2

1 Answers1

1

Google does not delete files inside vm instances. You may want to check the logs to see what happened when you left your instance. Be sure you don't have any start-up scripts that may have deleted data.

Dion V
  • 121
  • 2