0

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/user@1008.service/<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?

Daniel
  • 1
  • 2
  • 2
    The correct syntax is `journalctl --user-unit .service ...` – Michael Hampton Jul 27 '21 at 13:00
  • Yeah, that worked perfectly. But I always used the syntax `journalctl --user -u -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 .service` Thank you – Daniel Jul 27 '21 at 15:10

0 Answers0