Skip to content

Commit

Permalink
add unit configuration file example for the daemon command
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 30, 2016
1 parent 7299bf4 commit 0dc526e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

7.01 2016-07-30
7.01 2016-07-31
- Improved support for systemd.
- Fixed a bug in Mojo::Server::Prefork where PID files would not contain a
newline character.
Expand Down
14 changes: 14 additions & 0 deletions lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -42,6 +42,20 @@ L<Mojo::Server::Daemon/"listen">.
$ ./script/my_app daemon -l https://[::]:3000
Server available at https://[::]:3000

To manage the web server with systemd, you can use a unit configuration file
like this.

[Unit]
Description=My Mojolicious application
After=network.target

[Service]
Type=simple
ExecStart=/home/sri/myapp/script/my_app daemon -m production -l http://*:8080

[Install]
WantedBy=multi-user.target

On UNIX platforms you can also add preforking and switch to a multi-process
architecture with L<Mojolicious::Command::prefork>, to take advantage of
multiple CPU cores and copy-on-write memory management.
Expand Down

0 comments on commit 0dc526e

Please sign in to comment.