Skip to content

systemd service: Unable to determine the HOME environment variable #1849

@elboulangero

Description

@elboulangero
    GoAccess - version 1.4 - May 18 2020 01:45:26
    Config file: No config file used
    Fatal error has occurred
    Error occurred at: src/util.c - get_home - 453
    Unable to determine the HOME environment variable.

When running from a systemd service, there's very few environment
variables defined. Which env variables are available exactly is
explained here

Short version, here's what printenv gives me, in a script that is
spawned by logrotate, which is itself started daily by systemd:

    + printenv
    PWD=/
    LANG=en_US.UTF-8
    INVOCATION_ID=dbefda3a93634d16bca7ba0e077d57da
    SHLVL=1
    JOURNAL_STREAM=9:52249
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    _=/usr/bin/printenv

I think GoAccess should not fail in this case. If it can't get the env
variable HOME, then it means there's no file HOME/.goaccessrc,
and GoAccess should be happy with that and just keep going.

What do you think? See PR #1850.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions