Skip to content

Issue with setting as service #445

Description

@shd128

I'm trying to set bitwarden_rs as service with this .service file:

[Unit]
Description=Bitwarden Server (Rust Edition)
Documentation=https://github.com/dani-garcia/bitwarden_rs
After=network.target

[Service]
# The user/group bitwarden_rs is run under. the working directory (see below) should allow write and read access to this user/group
User=bitwarden_rs
Group=bitwarden_rs
# The location of the .env file for configuration
EnvironmentFile=/root/bitwarden_rs-1.8.0/bitwarden_rs.env
# The location of the compiled binary
ExecStart=/root/bitwarden_rs-1.8.0
# Set reasonable connection and process limits
LimitNOFILE=1048576
LimitNPROC=64
# Isolate bitwarden_rs from the rest of the system
PrivateTmp=true
PrivateDevices=true
ProtectHome=true
ProtectSystem=strict
# Only allow writes to the following directory and set it to the working directory (user and password data are stored here)
WorkingDirectory=/root/bitwarden_rs-1.8.0
ReadWriteDirectories=/root/bitwarden_rs-1.8.0
# Allow bitwarden_rs to bind ports in the range of 0-1024
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

And I get this:

[root@preprod-bitwarden01 bitwarden_rs-1.8.0]#  journalctl -u bitwarden_rs.service
-- Logs begin at Tue 2019-03-26 09:25:40 EDT, end at Tue 2019-03-26 15:27:11 EDT. --
Mar 26 15:27:03 preprod-bitwarden01 systemd[1]: [/etc/systemd/system/bitwarden_rs.service:21] Failed to parse protect system va
Mar 26 15:27:03 preprod-bitwarden01 systemd[1]: Started Bitwarden Server (Rust Edition).
Mar 26 15:27:03 preprod-bitwarden01 systemd[1]: bitwarden_rs.service: main process exited, code=exited, status=217/USER
Mar 26 15:27:03 preprod-bitwarden01 systemd[1]: Unit bitwarden_rs.service entered failed state.
Mar 26 15:27:03 preprod-bitwarden01 systemd[1]: bitwarden_rs.service failed.
Mar 26 15:27:11 preprod-bitwarden01 systemd[1]: [/etc/systemd/system/bitwarden_rs.service:21] Failed to parse protect system va
[root@preprod-bitwarden01 bitwarden_rs-1.8.0]#  systemctl status bitwarden_rs.service
● bitwarden_rs.service - Bitwarden Server (Rust Edition)
   Loaded: loaded (/etc/systemd/system/bitwarden_rs.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2019-03-26 15:27:03 EDT; 32s ago
     Docs: https://github.com/dani-garcia/bitwarden_rs
 Main PID: 20453 (code=exited, status=217/USER)

Mar 26 15:27:03 preprod-bitwarden01 systemd[1]: Started Bitwarden Server (Rust Edition).
Mar 26 15:27:03 preprod-bitwarden01 systemd[1]: bitwarden_rs.service: main process exited, code=exited, status=217/USER
Mar 26 15:27:03 preprod-bitwarden01 systemd[1]: Unit bitwarden_rs.service entered failed state.
Mar 26 15:27:03 preprod-bitwarden01 systemd[1]: bitwarden_rs.service failed.
Mar 26 15:27:11 preprod-bitwarden01 systemd[1]: [/etc/systemd/system/bitwarden_rs.service:21] Failed to parse protect system va
[root@preprod-bitwarden01 bitwarden_rs-1.8.0]#

Any ideas?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions