[systemd-devel] Reason for su command to be ignored in target?

Mark Hounschell markh at compro.net
Wed Apr 17 13:08:20 PDT 2013


On 04/17/2013 01:32 PM, Lennart Poettering wrote:
> On Wed, 17.04.13 13:21, Mark Hounschell (markh at compro.net) wrote:
>
>>>> The only thing I see in /var/log/messages is:
>>>>
>>>> 2013-04-17T11:36:51.667308-04:00 utils-linux su: (to lcrs) root on
>>>> /dev/ttyS0
>>>
>>> Bu that's run on ttyS0? Is that really script? How do spawn that script?
>>>
>>
>>  From the service file:
>> ExecStart=/sbin/qlogin /dev/ttyS0 root --homedir=/lcrs --noutmp
>> --command=/bin/bash --login -c /lcrs/sh.lcrs
>>
>> Then in the sh.lcrs "script" ANY su command is borked.
>>
>>>> 2013-04-17T11:36:51.668896-04:00 utils-linux systemd-logind[1731]:
>>>> New session c4 of user lcrs.
>>>> 2013-04-17T11:36:51.705945-04:00 utils-linux systemd-logind[1731]:
>>>> Removed session c4.
>>>
>>> if you invoke "logger test" via su here, do you see it logging
>>> something?
>>>
>>> Maybe your implementation of "su" is borked? Some older implementations
>>> misused PAM and immediately closed the PAM session after creating
>>> it... Which implementation do you use?
>>>
>>
>> # rpm -qf /usr/bin/su
>> coreutils-8.17-6.2.1.i586
>
> That looks OK. Can you try the logger thing I suggested? That should
> tell us if the transition works at all...

Sorry, I had a dentist Apt.

Uh, I put this as the first command in the /lcrs/sh.lcrs script:

/bin/su -m -c "logger test" lcrs

This comes out in the log:

2013-04-17T15:41:29.754272-04:00 utils-linux systemd-logind[1722]: New 
session c1 of user lcrs.
2013-04-17T15:41:29.829129-04:00 utils-linux logger: test
2013-04-17T15:41:29.831565-04:00 utils-linux systemd-logind[1722]: 
Removed session c1.

A couple of strange things now. The rest of the script works fine now??? 
I removed the logger test and rebooted. The script is still working???? 
Is there something being cached somewhere? I swear anything I used su 
for was borked until I added that extra line???

Thanks
Mark


More information about the systemd-devel mailing list