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

David T. Lewis lewis at mail.msen.com
Tue Sep 13 00:26:38 UTC 2022


On Sun, Sep 11, 2022 at 05:34:56PM -0700, tim Rowledge 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?
> 

Levente has just (very recently) set this up to run on our new
Hetzner box. I am attaching a copy of the configuration files, which
can probably be adapted to run your local personal squeaksource.

The files that I am attaching are:

1) service.sh - This is the start script that lives in your home directory
for squeaksource. It replaces the ./run script that was previously used
for daemontools.  On our source.squeak.org server, the home directory for
squeaksource is located at /home/squeaksource/webserver/ so the file is
named /home/squeaksource/webserver/service.sh.

2) source-squeak-org.service - This is that actual systemd
configuration file. On our source.squeak.org server, it is installed
as /etc/systemd/system/source-squeak-org.service. 

3) service.tgz - Archive file in case you need an exact copy of the files.
These are copied relative to the root / of the file system, just for
reference. Unpack with "tar xzvf services.tgz" in some suitable empty
directory.

You can probably do the same thing on your own local squeaksource system.
If it works, then Levente gets the credit. If it does not work, then
blame me.

HTH,
Dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: service.tgz
Type: application/x-gtar
Size: 608 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220912/00cbd557/attachment.gtar>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: service.sh
Type: application/x-sh
Size: 390 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220912/00cbd557/attachment.sh>
-------------- next part --------------
[Unit]
Description=source.squeak.org service
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=squeaksource
Restart=always
RestartSec=1
LimitRTPRIO=2
WorkingDirectory=/home/squeaksource/webserver/
ExecStart=/home/squeaksource/webserver/service.sh

[Install]
WantedBy=multi-user.target


More information about the Squeak-dev mailing list