Gollum as a service

Felix edited this page Apr 27, 2017 · 18 revisions

LINUX (SYSTEMD)

A great introduction to systemd can be found here. If you have any questions, feel free to ping @tuftedocelot on GitHub or shoot an email to tuftedocelot@fastmail.fm.

Complete example of the service can be seen here.

System service

Should you want to run Gollum as a system service:

  1. Create a gollum.service file.
  2. Add a ExecStart=... line. This line specifies the location of gollum executable and arguments to run it with. Use Gollum README or gollum --help to display the list of available arguments.
    Complete example:
    ExecStart=/usr/local/bin/gollum --show-all "/home/someuser/wiki/"
    
  3. Start the service: [sudo] systemctl start gollum.service

System service, run under a particular user

Should you want to run Gollum as a system service, but under a particular user (root by default):

  1. Add a User=%i line to gollum.service file and rename the file to gollum@.service.
  2. Change the line ExecStart=/usr/local/bin/gollum --show-all "/home/someuser/wiki/" to ExecStart=/usr/local/bin/gollum --show-all "/home/%i/wiki/".
  3. Start the service: [sudo] systemctl start gollum@<target-user>.service, where <target-user> is the user to run Gollum under.

User service

There is an alternative to the previous setup: run the service in a user session. To achieve this:

  1. Complete the first two steps of making a system service (see above).
  2. Create the mkdir -p ~/.config/systemd/user/ folder and move the gollum.service file there. Edit gollum.service as needed.
  3. Start the user service via [sudo] systemctl --user start gollum.

LINUX (SysV)

Older Debian versions (and derived distributions like Ubuntu) still use a SysV-style init system, which uses shell scripts as service files. contrib/sysv-debian/ contains an example of such a service file.

To install it:

  1. Copy contrib/sysv-debian/init.d/gollum to /etc/init.d/ on your system.
  2. Adapt the GOLLUM_* variables to your needs:
    GOLLUM_USER sets the user the gollum process will be run as,
    GOLLUM_BASE sets the path to the repository that contains the wiki contents, and
    GOLLUM_OPTS allows you to set additional parameters passed to gollum on the commandline (see gollum --help for documentation on those).
  3. Make the script executable if it isn't already:
    chmod +x /etc/init.d/gollum
  4. Depending on your system, use service gollum start or /etc/init.d/gollum start to start Gollum.
    The script understands the parameters start, stop, restart, and status.

LINUX/BSD (OPENRC)

Basic information on OpenRC can be found here.

Complete example of the service can be seen here.

FreeBSD

A script to run it on FreeBSD as deamon can be found in the latest www/rubgem-gollum pkg here

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.