-
Notifications
You must be signed in to change notification settings - Fork 22
Daemon
Curly Turtle currently can not daemonize itself. But you can run it as a daemon if you are using systemd. The supported operating systems include:
- RHEL/CentOS 7.0 or higher
- Fedora 15 or higher
- Debian 8.0 or higher
- Ubuntu 15.04 or higher
- openSUSE 12.2 or higher
- Arch Linux
Start by creating a file called /etc/systemd/system/curly-turtle@.service, with the following content:
[Unit]
Description=Curly Turtle
After=network.target
[Service]
User=nobody
ExecStart=/usr/bin/curly-turtle -c /etc/curly-turtle/%i.yml
[Install]
WantedBy=multi-user.target
Then run systemctl daemon-reload as root to let systemd loads it.
Next, create the directory /etc/curly-turtle. Put the configuration files in here, make sure the file names end with .yml, for example, default.yml.
Run systemctl start curly-turtle@nameofconfig to start Curly Turtle as a daemon, where what's after the @ is the name of the configuration file you want to use without trailing .yml. For example, if the configuration file is called default.yml, the command will be systemctl start curly-turtle@default.
You can also run multiple instances of Curly Turtle with different configurations. Do so by creating other configurations under /etc/curly-turtle/, and run the above command with different arguments after @.
Run systemctl status curly-turtle@nameofconfig to see the status of corresponding Curly-Turtle instance. And use systemctl stop curly-turtle@nameofconfig to stop it.
To start Curly Turtle every time the operating system boots, run systemctl enable curly-turtle@nameofconfig as root. To cancel this, run systemctl disable curly-turtle@nameofconfig.
To see the log, run journalctl -u curly-turtle@nameofconfig.
If you are not using systemd, hurry up and switch to systemd you can use nohup curly-turtle > /dev/null & to make it run on background, and stop it by killing the process.