Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to install as daemon #1

Open
jdupl opened this issue Jan 14, 2014 · 1 comment
Open

Add script to install as daemon #1

jdupl opened this issue Jan 14, 2014 · 1 comment

Comments

@jdupl
Copy link
Owner

jdupl commented Jan 14, 2014

Write a script to install a daemon in /etc/init.d to start the LCD at boot.
Use start-stop-daemon for control over the daemon.

@coofercat
Copy link

Not a script to make it into a daemon, but here's a Systemd Service Unit that will start the script (as a daemon), any STDOUT/STDERR will go to syslog. The process can be enabled at boot time, started and stopped as any other system service.

I'd personally recommend changing the logging to write to STDOUT (so it goes into syslog, is rotated, etc). I also removed the ---- type lines from the log, and removed the timestamps from lines (since syslog puts it own on)

[Unit]
Description=QnapFreeLCD

[Service]
Type=simple
WorkingDirectory=/opt/QnapFreeLCD
ExecStart=/opt/QnapFreeLCD/lcd-control.ksh
Restart=on-failure
TimeoutStopSec=30

[Install]
WantedBy=multi-user.target

Put this file into /lib/systemd/system/lcd-control.service. You can start and stop it with systemctl start lcd-control or systemctl stop lcd-control. Enable at boot with systemctl enable lcd-control.

PS. Nice script - old as the hills now, but still does a decent job - thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants