3 homepage: https://git.rootprojects.org/root/serviceman
5 Serviceman: cross-platform service management for Linux, Mac, and Windows.
7 Serviceman is a hassle-free wrapper around your system launcher. It works with the default system launcher to make it easy to start _user_- and _system_-level services, such as webservers, backup scripts, network and system tools, etc.
12 - The Registry (Windows)
15 Serviceman can run an app in just about any programming language very simply.
17 If you'd like to learn what `serviceman` does without actually making changes,
18 add the `--dryrun` option.
22 **Development Server**
27 sudo env PATH="$PATH" \
28 serviceman add --system --cap-net-bind \
29 npx nodemon ./server.js
37 sudo env PATH="$PATH" \
38 serviceman add --system --cap-net-bind \
45 pushd ./my-go-package/
47 sudo env PATH="$PATH" \
48 serviceman add --system \
49 go run -mod=vendor cmd/my-service/*.go --port 3000
53 pushd ./my-go-package/
54 go build -mod=vendor cmd/my-service
56 sudo env PATH="$PATH" \
57 serviceman add --cap-net-bind --system \
58 ./my-service --port 80
64 sudo env PATH="$PATH" serviceman add bash ./backup.sh /mnt/data
67 ## What a typical systemd .service file looks like
71 Description=example-service
72 After=network-online.target
73 Wants=network-online.target systemd-networkd-wait-online.service
83 WorkingDirectory=/srv/example-service
84 ExecStart=/srv/example-service/bin/example-command start
85 ExecReload=/bin/kill -USR1 $MAINPID
87 # Allow the program to bind on privileged ports, such as 80 and 443
88 CapabilityBoundingSet=CAP_NET_BIND_SERVICE
89 AmbientCapabilities=CAP_NET_BIND_SERVICE
93 WantedBy=multi-user.target
96 ## What a typical launchd .plist file looks like
99 <?xml version="1.0" encoding="UTF-8"?>
100 <!-- Generated for serviceman. Edit as you wish, but leave this line. -->
101 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
102 <plist version="1.0">
105 <string>example-service</string>
106 <key>ProgramArguments</key>
108 <string>/Users/me/example-service/bin/example-command</string>
109 <string>start</string>
117 <key>WorkingDirectory</key>
118 <string>/Users/me/example-service</string>
120 <key>StandardErrorPath</key>
121 <string>/Users/me/.local/share/example-service/var/log/example-service.log</string>
122 <key>StandardOutPath</key>
123 <string>/Users/me/.local/share/example-service/var/log/example-service.log</string>
128 ### Use `--dryrun` to see the generated launcher config:
131 sudo env PATH="$PATH" \
132 serviceman add --system --dryrun \
133 bash ./backup.sh /mnt/data
136 ### See the (sub)command help
138 The main help, showing all subcommands:
144 Sub-command specific help:
147 serviceman add --help