Score:0

Service not logging to journalctl

in flag

I have a user service which is placed under /home/<user>/.config/systemd/user/<service>.service

When I perform systemctl --user status <service> I have the desired output, for example:

<user>@<server>:~$ systemctl --user status <service>
● <service>.service - Service
     Loaded: loaded (/home/<user>/.config/systemd/user/<service>.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-07-27 10:23:34 UTC; 9min ago
   Main PID: 19059 (<service>)
     CGroup: /user.slice/user-1008.slice/[email protected]/<service>.service
             └─19059 /home/<user>/.local/share/<software>/install/active_release/bin/<software>-validator

Logs
Logs
Logs

But when trying to see the full logs with journalctl --user -u <service> -f I can't see anything, the output is the following:

<user>@<server>:~$ journalctl --user -u <service> -f
No journal files were found.

I have this setup running in a lot of other servers with exactly the same configuration, but this happens only in this one which is some servers from Equinix, maybe there is some different configuration for journalctl in this provider? But it's important to point out that I have installed other services in this machine (not users ones, but system-wide) and it haven't happened.

/etc/systemd/journal.conf is in its default configuration.

I have seen this post slightly related with my problem: Linux journalctl not synced with systemctl status / Journalctl not updating, I tried to insert StandardOutput=journal and StandardError=journal under the [Service] section, did systemctl --user daemon-reload and restarted the service but I can't see any logs in journalctl yet.

I also checked my /var to validate if it couldn't be lack of disk space, but I have quite a lot of space free in my disk.

My service is configured like this now:

[Unit]
Description=<Service description>
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1

EnvironmentFile=/home/<user>/rpc.env

ExecStart=/home/<user>/bin/<service_script>.sh

#ExecStartPost=/usr/bin/taskset -a -p -c 5-23 28-47 $MAINPID
CPUAffinity=5-23 28-47

Nice=-10


LimitNOFILE=700000
LimitNPROC=700000

LogRateLimitIntervalSec=0
LogRateLimitBurst=0

WorkingDirectory=/home/<user>/

[Install]
WantedBy=default.target

Do you guys have any ideia how I can fix it?

Michael Hampton avatar
cz flag
The correct syntax is `journalctl --user-unit <name>.service ...`
Daniel avatar
in flag
Yeah, that worked perfectly. But I always used the syntax `journalctl --user -u <service> -f` and it still work in my other servers. Probably these nodes came with all latest packages, and in a new version of systemd the syntax above may be deprecated. The correct one is indeed `journalctl --user-unit <name>.service` Thank you
us flag
Had exactly the same issue, the answer here in the comments should be an actual answer and accepted
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.