[squeak-dev] referring to a cli command in a unix systemd unit file

Tobias Pape Das.Linux at gmx.de
Mon Sep 12 04:57:20 UTC 2022

> On 12. Sep 2022, at 02:34, tim Rowledge <tim at rowledge.org> wrote:
> I'm making a pass at enabling personal squeaksource run cleanly under systemd instead of daemontools. The only bit that seems to be problematic right now is making the ExecStart part handle the older style `cat webPort` fragment.
> I've banged away a google to see how to do this but nothing I've spotted so far looks like it will work. There surely must be a way within a service unit file to find the value of `cat webPort` and append it to the 
> ExecStart=vm/squeak -vm-sound-null -vm-display-null -mmap 1024m -eden 16m ss.image run.st `cat webPort`
> ... but damned if I can get it to work...
> What stupidly simple thing have I missed?

What about that:

$ cat webPort

And in the service:

ExecStart=vm/squeak -vm-sound-null -vm-display-null -mmap 1024m -eden 16m ss.image run.st $WEB_PORT

Even better yet:

$ cat /etc/default/squeaksource
VM_OPTS=-vm-sound-null -vm-display-null -mmap 1024m -eden 16m

and in the Service:

ExecStart=/path/to/vm/squeak $VM_OPTS $IMAGE_PATH $STARTUP_SCRIPT $WEB_PORT

Because then you do not need to "systemctl daemon-reload" each time you change one of the thins in the env fileā€¦

Best regards

> tim

More information about the Squeak-dev mailing list