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 npx nodemon
36 sudo env PATH="$PATH" \
37 serviceman add --system --cap-net-bind npm start
43 pushd ./my-go-package/
45 sudo env PATH="$PATH" \
46 serviceman add --system \
47 go run -mod=vendor cmd/my-service/*.go --port 3000
51 pushd ./my-go-package/
52 go build -mod=vendor cmd/my-service
54 sudo env PATH="$PATH" \
55 serviceman add --cap-net-bind --system \
56 ./my-service --port 80
62 sudo env PATH="$PATH" serviceman add bash ./backup.sh /mnt/data
65 ## What a typical systemd .service file looks like
69 Description=example-service
70 After=network-online.target
71 Wants=network-online.target systemd-networkd-wait-online.service
81 WorkingDirectory=/srv/example-service
82 ExecStart=/srv/example-service/bin/example-command start
83 ExecReload=/bin/kill -USR1 $MAINPID
85 # Allow the program to bind on privileged ports, such as 80 and 443
86 CapabilityBoundingSet=CAP_NET_BIND_SERVICE
87 AmbientCapabilities=CAP_NET_BIND_SERVICE
91 WantedBy=multi-user.target
94 ## What a typical launchd .plist file looks like
97 <?xml version="1.0" encoding="UTF-8"?>
98 <!-- Generated for serviceman. Edit as you wish, but leave this line. -->
99 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
100 <plist version="1.0">
103 <string>example-service</string>
104 <key>ProgramArguments</key>
106 <string>/Users/me/example-service/bin/example-command</string>
107 <string>start</string>
115 <key>WorkingDirectory</key>
116 <string>/Users/me/example-service</string>
118 <key>StandardErrorPath</key>
119 <string>/Users/me/.local/share/example-service/var/log/example-service.log</string>
120 <key>StandardOutPath</key>
121 <string>/Users/me/.local/share/example-service/var/log/example-service.log</string>
126 ### Use `--dryrun` to see the generated launcher config:
129 sudo env PATH="$PATH" \
130 serviceman add --system --dryrun \
131 bash ./backup.sh /mnt/data
134 ### See the (sub)command help
136 The main help, showing all subcommands:
142 Sub-command specific help:
145 serviceman add --help