Skip to content

milk web で --db=を指定しても、環境変数HOMEが無いとエラーになる #90

@hkuno9000

Description

@hkuno9000

Ubuntu 18.04LTS にて、milk web のサービス化を試みたのですが
--db= でパスを指定しても、環境変数HOMEが未定義の状態では、
下記エラーが出て、起動に失敗しました。

error

milk[25792]: /var/lib/gems/2.5.0/gems/milkode-1.8.9.1/lib/milkode/common/dbdir.rb:14:in `expand_path': couldn't find login name -- expanding `~' (ArgumentError)

service の Environment= に HOME変数を定義することで起動に成功しましたが、
--db= でパスが指定されている場合は、DBパス参照に "~" ($HOME) を必要としないようにできませんでしょうか。

/etc/systemd/system/milkweb.service

[Unit]
Description = milk web

[Service]
Environment='HOME=/home/USER'
ExecStart = /usr/local/bin/milk web -n --host 0.0.0.0 --db=/home/USER/.milkode
Restart = always
Type = simple

[Install]
WantedBy = multi-user.target

インストール覚書

https://qiita.com/hkuno/items/27ad63df0c692ef5c9e1

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