Re: [gentoo-user] Re: executing a command as a nologin user
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 07/15/2016 09:45 AM, Fernando Rodriguez wrote: > On 07/14/2016 09:36 PM, Jonathan Callen wrote: >> On 07/14/2016 05:19 PM, Fernando Rodriguez wrote: >>> On 07/13/2016 01:41 PM, wabe wrote: Fernando Rodriguezwrote: >>> > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > On 07/13/2016 07:10 AM, Alan McKinnon wrote: >> On 12/07/2016 03:47, jens w wrote: >>> .procmailrc >>> :0 c >>> * !^X-Loop: n...@example.com >>> | formail -X "From:" | $HOME/bin/script.sh >>> >>> procmail.log >>> procmail: Executing " formail -X "From:" | $HOME/bin/script.sh >>> >>> for incoming mail, a script is executed. logfile has the same >>> entry as it is in other users. but the script do nothing. >>> >>> How executing a command as a nologin user? >>> >> >> >> You can't, not the way you are doing it. >> You want to launch a shell script for the user, but the user's >> shell is /sbin/nologin. This exits immediately without launching >> the script. >> >> Give the user a real shell. >> >> Alan >> > > I've been following this thread and thinking the same thing but > wasn't sure. > > What if you invoke the shell directly instead of the script, either: > /bin/sh -c "" or /bin/sh -c "$(cat
Re: [gentoo-user] Re: executing a command as a nologin user
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 07/14/2016 09:36 PM, Jonathan Callen wrote: > On 07/14/2016 05:19 PM, Fernando Rodriguez wrote: >> On 07/13/2016 01:41 PM, wabe wrote: >>> Fernando Rodriguezwrote: >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 07/13/2016 07:10 AM, Alan McKinnon wrote: > On 12/07/2016 03:47, jens w wrote: >> .procmailrc >> :0 c >> * !^X-Loop: n...@example.com >> | formail -X "From:" | $HOME/bin/script.sh >> >> procmail.log >> procmail: Executing " formail -X "From:" | $HOME/bin/script.sh >> >> for incoming mail, a script is executed. logfile has the same >> entry as it is in other users. but the script do nothing. >> >> How executing a command as a nologin user? >> > > > You can't, not the way you are doing it. > You want to launch a shell script for the user, but the user's > shell is /sbin/nologin. This exits immediately without launching > the script. > > Give the user a real shell. > > Alan > I've been following this thread and thinking the same thing but wasn't sure. What if you invoke the shell directly instead of the script, either: /bin/sh -c "" or /bin/sh -c "$(cat
[gentoo-user] Re: executing a command as a nologin user
On 07/14/2016 05:19 PM, Fernando Rodriguez wrote: > On 07/13/2016 01:41 PM, wabe wrote: >> Fernando Rodriguezwrote: > >>> -BEGIN PGP SIGNED MESSAGE- >>> Hash: SHA256 >>> >>> On 07/13/2016 07:10 AM, Alan McKinnon wrote: On 12/07/2016 03:47, jens w wrote: > .procmailrc > :0 c > * !^X-Loop: n...@example.com > | formail -X "From:" | $HOME/bin/script.sh > > procmail.log > procmail: Executing " formail -X "From:" | $HOME/bin/script.sh > > for incoming mail, a script is executed. logfile has the same > entry as it is in other users. but the script do nothing. > > How executing a command as a nologin user? > You can't, not the way you are doing it. You want to launch a shell script for the user, but the user's shell is /sbin/nologin. This exits immediately without launching the script. Give the user a real shell. Alan >>> >>> I've been following this thread and thinking the same thing but >>> wasn't sure. >>> >>> What if you invoke the shell directly instead of the script, either: >>> /bin/sh -c "" or /bin/sh -c "$(cat