[systemd-devel] Quick ? about ExecStartPre and Restart
Jan Alexander Steffens
jan.steffens at gmail.com
Wed Jul 3 23:35:48 PDT 2013
On Thu, Jul 4, 2013 at 2:04 AM, Paul D. DeRocco <pderocco at ix.netcom.com> wrote:
> 1) I want my service executable to be copied from flash to RAM disk, and
> then executed from there, so that the original can be updated while the copy
> is running.
You don't need to copy it to somewhere else. You can replace an
executable without the running process being disturbed, by deleting
the file and creating (or moving) a new one in its place. Most tools
(like "cp") will do this when they overwrite a file. Then simply
restart the service (or have it exec() itself), and the new version
will be running.
The old version of the executable will continue to exist—even though
it has no file name—until nothing uses it anymore.
More information about the systemd-devel