itch the order of the arguments in "daemon_flags",
/usr/local/bin/fossil server --repolist --port 8888 /home/_fossil/example
the process command is changed to this.
/usr/local/bin/fossil server /home/_fossil/example /home/_fossil/example 8888 /home/_fossil/example
The commented "pexp=" line instructs rc.subr to choose the process whose command and arguments text starts with this:
Enabling the daemonOnce you have created /etc/rc.d/fossil, run these commands.
rcctl enable fossil # add fossil to pkg_scripts in /etc/rc.conf.local rcctl start fossil # start the daemon now
The daemon should now be running and set to start at boot.
Multiple daemonsYou may want to serve multiple fossil instances with different options. For example,
- If different users own different repositories, you may want different users to serve different repositories.
- You may want to serve different repositories on different ports so you can control them differently with, for example, HTTP reverse proxies or pf(4).
To run multiple fossil daemons, create multiple files in /etc/rc.d, and enable each of them. Here are two approaches for creating the files in /etc/rc.d: Symbolic links and copies.
Symbolic linksSuppose you want to run one fossil daemon as user "user1" on port 8881 and another as user "user2" on port 8882. Create the files with ln(1), and configure them to run different fossil commands.
cd /etc/rc.d ln -s fossil fossil1 ln -s fossil fossil2 rcctl enable fossil1 fossil2 rcctl set fossil1 user user1 rcctl set fossil2 user user2 rcctl set fossil1 flags 'server /home/user1/repo1.fossil --port 8881' rcctl set fossil2 flags 'server /home/user2/repo2.fossil --port 8882' rcctl start fossil1 fossil2
CopiesYou may want to run fossil daemons that are too different to configure just with rcctl(8). In particular, you can't change the "pexp" with rcctl.
If you want to run fossil commands that are more different, you may prefer to create separate files in /etc/rc.d. Replace "ln -s" above with "cp" to accomplish this.
cp /etc/rc.d/fossil /etc/rc.d/fos