Thursday 4 May 2017

Shell Script Spawned From systemd Node App Doesn't Edit etc File

I have a systemd service that starts a Node app on boot. The Node app uses child_process.spawnSync to launch a shell script that edits /etc/wpa_supplicant/wpa_cli-actions.sh using sed.

The wpa_cli-actions.sh file is edited correctly if I launch the Node app manually from the command line, but is not edited correctly when the app is launched by systemd. My systemd service file is based on another one that launches a similar service, so I'm not sure what I'm doing wrong. I haven't seen any errors related to this in the journalctl output. Below is my service file.

[Unit]
Description=The Edison status and configuration service
After=mdns.service

[Service]
ExecStart=/bin/su root -c 'node /usr/lib/config-server/app.js'
Restart=always
RestartSec=10s
StandardOutput=journal
StandardError=journal
SyslogIdentifier=edison-config
PrivateTmp=no
Environment=NODE_ENV=production
User=root
Group=root

[Install]
WantedBy=default.target



via user2174937

No comments:

Post a Comment