mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Issue with setting as service #265
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @shd128 on GitHub (Mar 26, 2019).
I'm trying to set bitwarden_rs as service with this .service file:
And I get this:
Any ideas?
@dani-garcia commented on GitHub (Mar 27, 2019):
The error message seems to imply there is a problem with the line 21, the protect system one. I'd try to delete it to see if that helps. Maybe your system has an old systemd version that doesn't support that functionality?
This is a bit of a guess, since I don't know a lot about systemd.
@mqus commented on GitHub (Mar 27, 2019):
I don't know about the
ProtectSystemvariable, this looks correct to me... i googled the setting quickly, it was added in 2016, and I think that your systemd version should include that feature by now. If not, just comment it out by placing a#in front of it and try starting the service without it, like dani-garcia recommended.But it still won't work because
ExecStart=is wrong. this path should point to the binary directly, not some folder.(systemd doesn't know what to execute in that folder). If/root/bitwarden_rs-1.8.0is the directory you downloaded and compiled bitwarden_rs in, the line should beExecStart=/root/bitwarden_rs-1.8.0/target/release/bitwarden_rsAnother thing: as the binary seems to be in
roots home directory (/root/), did you create a bitwarden_rs user and group and allow access to/root/bitwarden_rs-1.8.0? If not, you should do that, or, if you don't need the extra layer of security since it's in a vm anyway, simply set theUserandGrouptorootEdit: don't forget to
systemctl daemon-reloadafter updating your service file!@shd128 commented on GitHub (Mar 27, 2019):
I tried both of your recommendations, but I'm still having some issues.
I have RHEL 7.6 so I think I have a recent version of systemd.
With this file:
I get this:
@shd128 commented on GitHub (Mar 27, 2019):
Just in case, I do have that file:
@dani-garcia commented on GitHub (Mar 27, 2019):
The NAMESPACE issue appeared to someone else too https://github.com/dani-garcia/bitwarden_rs/issues/363. A user recommended removing the sandboxing options, but we didn't get an answer if that worked or not.
@mqus commented on GitHub (Mar 27, 2019):
could you do
systemctl status bitwarden_rs.service -l? the error message was cut off.I'm not familiar with RHEL but it seems like systemd was only patched, not upgraded since 2015 in RHEL 7.
@shd128 commented on GitHub (Mar 27, 2019):
[root@preprod-bitwarden01 system]# systemctl status bitwarden_rs.service -l
● 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 Wed 2019-03-27 08:59:24 EDT; 17min ago
Docs: https://github.com/dani-garcia/bitwarden_rs
Main PID: 3326 (code=exited, status=226/NAMESPACE)
Mar 27 08:59:23 preprod-bitwarden01.prep.siif2 systemd[1]: Started Bitwarden Server (Rust Edition).
Mar 27 08:59:24 preprod-bitwarden01.prep.siif2 systemd[3326]: Failed at step NAMESPACE spawning /root/bitwarden_rs-1.8.0/target/release/bitwarden_rs: No such file or directory
Mar 27 08:59:24 preprod-bitwarden01.prep.siif2 systemd[1]: bitwarden_rs.service: main process exited, code=exited, status=226/NAMESPACE
Mar 27 08:59:24 preprod-bitwarden01.prep.siif2 systemd[1]: Unit bitwarden_rs.service entered failed state.
Mar 27 08:59:24 preprod-bitwarden01.prep.siif2 systemd[1]: bitwarden_rs.service failed.
Warning: bitwarden_rs.service changed on disk. Run 'systemctl daemon-reload' to reload units.
[root@preprod-bitwarden01 system]#
@shd128 commented on GitHub (Mar 27, 2019):
I will try this and let you know
@shd128 commented on GitHub (Mar 27, 2019):
I went to the config file but couldn't figure out which are this options.
Could you please clarify?
@mqus commented on GitHub (Mar 27, 2019):
you can comment out
PrivateTmp,PrivateDevices,ProtectHomeandReadWriteDirectories.@mqus commented on GitHub (Mar 27, 2019):
Could you also post the output of
systemctl --version?@shd128 commented on GitHub (Mar 27, 2019):
[root@preprod-bitwarden01 ~]# systemctl --version
systemd 219
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN
@shd128 commented on GitHub (Mar 27, 2019):
It's working now!!!
Thank you so much to both of you!
@dani-garcia commented on GitHub (Mar 30, 2019):
Seeing as this is solved, I'll close it now. Feel free to open another one if you have more problems.