[systemd-devel] systemd dns smart?

2023-08-24 Thread Marc
I was just 'cleaning up' a bit an ubuntu server from unnecessary running 
processes. I think I removed also some things from systemd. Now I have that 
some external auth that is slow due to the fact that the external auth host has 
two ip addresses configured. One of those ip addresses is not reachable from my 
ubuntu server. 
This results in the default behaviour that when you do a few pings some are not 
replying because the ping is using the unreachable ip address. 

I don't think I noticed this behaviour before, my question is now. 

Is there something 'smart' in systemd that automatically prefers to use the ip 
address that is routable?




Re: [systemd-devel] Error during SCC_DAEMON installation

2023-08-24 Thread Greg KH
On Thu, Aug 24, 2023 at 01:28:57PM +, Maber, Paul wrote:
> Classification: Confidential

Really?  You sent this to a public mailing list :(

> CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI 
> Group Inc. and its affiliates may be contained in this message. If you are 
> not a recipient indicated or intended in this message (or responsible for 
> delivery of this message to such person), or you think for any reason that 
> this message may have been addressed to you in error, you may not use or copy 
> or deliver this message to anyone else. In such case, you should destroy this 
> message and are asked to notify the sender by reply e-mail

Now deleted.


[systemd-devel] Why are the priorities of stdout and stderr the same

2023-08-24 Thread Cecil Westerhof
Normally in a script when something is send to stdout it is seen as an
error has occurred.
But in systemd both get a priority of 6 (info).
Why does stderr not get a priority of 3 (err), or at least lower as stdout?
Now when I want the things send to stderr I also get the things send to
stdout.

-- 
Cecil Westerhof


[systemd-devel] Error during SCC_DAEMON installation

2023-08-24 Thread Maber, Paul
Classification: Confidential

When installing the SAP Cloud Connector, I am getting the following errors.  
The installation is being performed by the user root as instructed.

:/opt/sap/scc # journalctl -xeu scc_daemon.service
Aug 24 13:41:35  scc_daemon[5574]: scc_Daemon start failed, see 
logfile: /opt/sap/scc/scc_daemon.log
Aug 24 13:41:35  systemd[1]: scc_daemon.service: Control process 
exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStart= process belonging to unit scc_daemon.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Aug 24 13:41:35  systemd[1]: scc_daemon.service: Failed with result 
'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit scc_daemon.service has entered the 'failed' state with result 
'exit-code'.
Aug 24 13:41:35  systemd[1]: scc_daemon.service: Unit process 5657 
(su) remains running after unit stopped.
Aug 24 13:41:35  systemd[1]: Failed to start LSB: LJS Daemon.
░░ Subject: A start job for unit scc_daemon.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit scc_daemon.service has finished with a failure.
░░
░░ The job identifier is 2958 and the job result is failed.
Aug 24 13:55:16  systemd[1]: Starting LSB: LJS Daemon...
░░ Subject: A start job for unit scc_daemon.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit scc_daemon.service has begun execution.
░░
░░ The job identifier is 3575.
Aug 24 13:55:16  scc_daemon[6005]: Starting scc_Daemon
Aug 24 13:55:16  su[6088]: gkr-pam: couldn't get the password from 
user: Conversation error
Aug 24 13:55:16  su[6088]: pam_unix(su:auth): auth could not 
identify password for [sccadmin]
Aug 24 13:55:16  su[6088]: pam_sss(su:auth): authentication 
failure; logname= uid=0 euid=0 tty= ruser=root rhost= user=sccadmin
Aug 24 13:55:16  su[6088]: pam_sss(su:auth): received for user 
sccadmin: 10 (User not known to the underlying authentication module)
Aug 24 13:55:16  su[6088]: FAILED SU (to sccadmin) root on none
Aug 24 13:55:17  scc_daemon[6005]: scc_Daemon start failed, see 
logfile: /opt/sap/scc/scc_daemon.log
Aug 24 13:55:17  systemd[1]: scc_daemon.service: Control process 
exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStart= process belonging to unit scc_daemon.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Aug 24 13:55:17  systemd[1]: scc_daemon.service: Failed with result 
'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit scc_daemon.service has entered the 'failed' state with result 
'exit-code'.
Aug 24 13:55:17  systemd[1]: scc_daemon.service: Unit process 6088 
(su) remains running after unit stopped.
Aug 24 13:55:17  systemd[1]: Failed to start LSB: LJS Daemon.
░░ Subject: A start job for unit scc_daemon.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit scc_daemon.service has finished with a failure.
░░
░░ The job identifier is 3575 and the job result is failed.
lines 91-152/152 (END)

s:/opt/sap/scc # systemctl status scc_daemon.service
× scc_daemon.service - LSB: LJS Daemon
 Loaded: loaded (/etc/init.d/scc_daemon; generated)
 Active: failed (Result: exit-code) since Thu 2023-08-24 13:55:17 BST; 
10min ago
   Docs: man:systemd-sysv-generator(8)
Process: 6005 ExecStart=/etc/init.d/scc_daemon start (code=exited, 
status=1/FAILURE)

Aug 24 13:55:16  su[6088]: gkr-pam: couldn't get the password from 
user: Conversation error
Aug 24 13:55:16  su[6088]: pam_unix(su:auth): auth could not 
identify password for [sccadmin]
Aug 24 13:55:16  su[6088]: pam_sss(su:auth): authentication 
failure; logname= uid=0 euid=0 tty= ruser=root rhost= user=sccadmin
Aug 24 13:55:16  su[6088]: pam_sss(su:auth): received for user 
sccadmin: 10 (User not known to the underlying authentication module)
Aug 24 13:55:16  su[6088]: FAILED SU (to sccadmin) root on none
Aug 24 13:55:17  scc_daemon[6005]: scc_Daemon start failed, see 
logfile: /opt/sap/scc/scc_daemon.log
Aug 24 13:55:17  systemd[1]: scc_daemon.service: Control process 
exited, code=exited, status=1/FAILURE
Aug 24 13:55:17  systemd[1]: scc_daemon.service: Failed with result 
'exit-code'.
Aug 24 13:55:17  systemd[1]: scc_daemon.service: Unit process 6088 
(su) remains running after unit stopped.
Aug 24 13:55:17  systemd[1]: Failed to start LSB: LJS Daemon.

Log File: 

Re: [systemd-devel] Append to logfile with year-month

2023-08-24 Thread Donald Buczek
Consider the ugly

ExecStart=bash -c "whatever > /var/log/root/aptCacheUsage_$(date +%%Y-%%m).log 
2>&1"

or

ExecStart=bash -c "whatever | cronolog /var/log/root/aptCacheUsage_%%Y-%%m.log 
2>&1"

Best
  Donald


On 8/24/23 9:48 AM, Cecil Westerhof wrote:
> In a service file I can use:
>     StandardOutput=append:/var/log/root/aptCacheUsage.log
> 
> but I want to use something like:
>     StandardOutput=append:/var/log/root/aptCacheUsage_$(date +%%Y-%%m).log
> 
> Did does not work, because this puts it in:
>     /var/log/root/aptCacheUsage_$(date +%Y-%m).log
> 
> Is there a way I can put it in:
>     /var/log/root/aptCacheUsage_2023-08.log
> 
> while it would automatically next month go into:
>    /var/log/root/aptCacheUsage_2023-09.log
> 
> I could of-course put it into:
>     /var/log/root/aptCacheUsage.log
> 
> and at the beginning of the month move it if it exists with a timed service, 
> but I really would not like that kind of solution.
> 
> -- 
> Cecil Westerhof


-- 
Donald Buczek
buc...@molgen.mpg.de
Tel: +49 30 8413 1433


Re: [systemd-devel] Append to logfile with year-month

2023-08-24 Thread Mantas Mikulėnas
On Thu, Aug 24, 2023 at 10:49 AM Cecil Westerhof 
wrote:

> In a service file I can use:
> StandardOutput=append:/var/log/root/aptCacheUsage.log
>
> but I want to use something like:
> StandardOutput=append:/var/log/root/aptCacheUsage_$(date +%%Y-%%m).log
>
> Did does not work, because this puts it in:
> /var/log/root/aptCacheUsage_$(date +%Y-%m).log
>
> Is there a way I can put it in:
> /var/log/root/aptCacheUsage_2023-08.log
>
> while it would automatically next month go into:
>/var/log/root/aptCacheUsage_2023-09.log
>
>
Not with built-in systemd tools. If it's a periodic (not permanently
running) service, best you can do is script a monthly cronjob that
automatically edits the StandardOutput line in your .service unit.


> I could of-course put it into:
> /var/log/root/aptCacheUsage.log
>
> and at the beginning of the month move it if it exists with a timed
> service, but I really would not like that kind of solution.
>

It's called /etc/logrotate.conf and it's what everyone else does. It's what
Debian/Ubuntu itself uses for /var/log/apt*.log and such.

-- 
Mantas Mikulėnas


[systemd-devel] Append to logfile with year-month

2023-08-24 Thread Cecil Westerhof
In a service file I can use:
StandardOutput=append:/var/log/root/aptCacheUsage.log

but I want to use something like:
StandardOutput=append:/var/log/root/aptCacheUsage_$(date +%%Y-%%m).log

Did does not work, because this puts it in:
/var/log/root/aptCacheUsage_$(date +%Y-%m).log

Is there a way I can put it in:
/var/log/root/aptCacheUsage_2023-08.log

while it would automatically next month go into:
   /var/log/root/aptCacheUsage_2023-09.log

I could of-course put it into:
/var/log/root/aptCacheUsage.log

and at the beginning of the month move it if it exists with a timed
service, but I really would not like that kind of solution.

-- 
Cecil Westerhof