Files
ubicloud/rhizome/common/bin/daemonizer2
mohi-kalantari 496ebc92e9 Introduce daemonizer2 for better log handling and supporting argv
With the new version, we will not store the systemd unit logs in file
and instead rely on journalctl. This way the logs of last tries would
not get deleted.

Locking system used in the version 1 is also deleted since the unit name
is enough for locking purposes.

Stdin is also written to /dev/shm which is a filesystem on top of memory
which is faster and files are deleted on reboot; increasing performance
and security

Also in the new version, we can specify argv arguments instead of
putting the whole command in single quotes.

Unit name is now the second argv instead of the last. it was done because
it was always a single word and we could position is somewhere static

This is an example of version 1:

vm.sshable.cmd("common/bin/daemonizer 'sleep infinity' test_daemonizer")

This is an example of version2:

vm.sshable.cmd("common/bin/daemonizer2 run test_daemonizer2 sleep infinity")

The first parameter is used as the command name. there will be no -- in
daemonizer2 API and instead "clean" or "check" would be used. Also in order
to keep the style consistent, "run" command will be used to spawn up new units.

the second parameter would be used as the name and all the other parameters
would be used in the original script.
2025-04-10 12:17:47 +02:00

1.6 KiB
Executable File