Skip to content

Commit 288687b

Browse files
lexandr0sroot
and
root
authored
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 <[email protected]>
1 parent f175574 commit 288687b

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

rc.d/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Running wireproxy with rc.d
2+
3+
If you're on a rc.d-based distro, you'll most likely want to run Wireproxy as a systemd unit.
4+
5+
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.
6+
7+
# Setting up the unit
8+
9+
1. Copy the `wireproxy` file from this directory to `/usr/local/etc/rc.d`.
10+
11+
2. If necessary, customize the unit.
12+
Edit the parts with `procname`, `command`, `wireproxy_conf` to point to the executable and the configuration file.
13+
14+
4. Add the following lines to `/etc/rc.conf` to enable wireproxy
15+
`wireproxy_enable="YES"`
16+
17+
5. Start wireproxy service and check status
18+
```
19+
sudo service wireproxy start
20+
sudo service wireproxy status
21+
```

rc.d/wireproxy

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
#
3+
# PROVIDE: wireproxy
4+
# REQUIRE: DAEMON
5+
# KEYWORD: nojail
6+
#
7+
8+
#
9+
# Add the following lines to /etc/rc.conf to enable wireproxy:
10+
#
11+
#wireproxy_enable="YES"
12+
#
13+
14+
. /etc/rc.subr
15+
16+
name=wireproxy
17+
rcvar=wireproxy_enable
18+
19+
load_rc_config $name
20+
procname="/bin/wireproxy"
21+
22+
wireproxy_enable=${wireproxy_enable:-"NO"}
23+
24+
wireproxy_bin=/bin/wireproxy
25+
wireproxy_conf=/etc/wireproxy.conf
26+
27+
command=${wireproxy_bin}
28+
command_args="-s -d -c ${wireproxy_conf}"
29+
30+
run_rc_command "$1"

0 commit comments

Comments
 (0)