mirror of
https://github.com/whyvl/wireproxy.git
synced 2025-04-29 19:01:42 +02:00
Add hint to run Wireproxy as system daemon in rc.d-based system (#164)
* Add hint for rc.d service * Update README.md --------- Co-authored-by: root <root@prox1.example.com>
This commit is contained in:
parent
f17557487d
commit
288687b873
2 changed files with 51 additions and 0 deletions
21
rc.d/README.md
Normal file
21
rc.d/README.md
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# Running wireproxy with rc.d
|
||||||
|
|
||||||
|
If you're on a rc.d-based distro, you'll most likely want to run Wireproxy as a systemd unit.
|
||||||
|
|
||||||
|
The provided systemd unit assumes you have the wireproxy executable installed on `/bin/wireproxy` and a configuration file stored at `/etc/wireproxy.conf`. These paths can be customized by editing the unit file.
|
||||||
|
|
||||||
|
# Setting up the unit
|
||||||
|
|
||||||
|
1. Copy the `wireproxy` file from this directory to `/usr/local/etc/rc.d`.
|
||||||
|
|
||||||
|
2. If necessary, customize the unit.
|
||||||
|
Edit the parts with `procname`, `command`, `wireproxy_conf` to point to the executable and the configuration file.
|
||||||
|
|
||||||
|
4. Add the following lines to `/etc/rc.conf` to enable wireproxy
|
||||||
|
`wireproxy_enable="YES"`
|
||||||
|
|
||||||
|
5. Start wireproxy service and check status
|
||||||
|
```
|
||||||
|
sudo service wireproxy start
|
||||||
|
sudo service wireproxy status
|
||||||
|
```
|
30
rc.d/wireproxy
Normal file
30
rc.d/wireproxy
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# PROVIDE: wireproxy
|
||||||
|
# REQUIRE: DAEMON
|
||||||
|
# KEYWORD: nojail
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Add the following lines to /etc/rc.conf to enable wireproxy:
|
||||||
|
#
|
||||||
|
#wireproxy_enable="YES"
|
||||||
|
#
|
||||||
|
|
||||||
|
. /etc/rc.subr
|
||||||
|
|
||||||
|
name=wireproxy
|
||||||
|
rcvar=wireproxy_enable
|
||||||
|
|
||||||
|
load_rc_config $name
|
||||||
|
procname="/bin/wireproxy"
|
||||||
|
|
||||||
|
wireproxy_enable=${wireproxy_enable:-"NO"}
|
||||||
|
|
||||||
|
wireproxy_bin=/bin/wireproxy
|
||||||
|
wireproxy_conf=/etc/wireproxy.conf
|
||||||
|
|
||||||
|
command=${wireproxy_bin}
|
||||||
|
command_args="-s -d -c ${wireproxy_conf}"
|
||||||
|
|
||||||
|
run_rc_command "$1"
|
Loading…
Add table
Add a link
Reference in a new issue