Dear All,
I am trying to run a script with the following command:
echo "~/scripts/teste.sh" | at 5:59PM
but nothing happens.
My script is:
--------------------------------------- #!/bin/bash
gxmessage -center \ -buttons "Yes":1,"Of Course":2 \ -geometry 290x80 \ -title "Linux Journal Question" 'Does Shawn Powers ROCK?'
answer=$?
case "$answer" in 1) gxmessage -center "You said 'YES'" ;; *) gxmessage -center "I agree, Of Course." ;; esac ---------------------------------------
If I run
sh ~/scripts/teste.sh
the script works as expected.
Any ideas?
Thanks in advance,
Paul
On 11/19/21 11:04 AM, Paul Smith wrote:
Dear All,
I am trying to run a script with the following command:
echo "~/scripts/teste.sh" | at 5:59PM
but nothing happens.
Try putting some echo commands into the script, redirected to a file so that you can see if the script runs at all, and if so, how far it gets.
On Fri, Nov 19, 2021 at 7:09 PM Joe Zeff joe@zeff.us wrote:
I am trying to run a script with the following command:
echo "~/scripts/teste.sh" | at 5:59PM
but nothing happens.
Try putting some echo commands into the script, redirected to a file so that you can see if the script runs at all, and if so, how far it gets.
Thanks, Joe. I am going to try that, but the following log may help to trace down the problem:
--------------------------------------- Nov 19 19:07:00 localhost atd[45259]: Starting job 110 (a0006e01a0663b) for user 'x' (1000) Nov 19 19:07:00 localhost audit[45259]: USER_ACCT pid=45259 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_localuser acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost systemd-logind[1147]: New session 17 of user x. Nov 19 19:07:00 localhost systemd[1]: Started Session 17 of User x. Nov 19 19:07:00 localhost atd[45259]: pam_unix(atd:session): session opened for user x(uid=1000) by (uid=0) Nov 19 19:07:00 localhost audit[45259]: USER_START pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost audit[45259]: CRED_ACQ pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_env,pam_localuser,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost atd[45263]: Exec failed for mail command: No such file or directory Nov 19 19:07:00 localhost audit[45259]: CRED_DISP pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_env,pam_localuser,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost atd[45259]: pam_unix(atd:session): session closed for user x Nov 19 19:07:00 localhost audit[45259]: USER_END pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost systemd[1]: session-17.scope: Deactivated successfully. ---------------------------------------
Paul
Also check at -l, or atq to see if it is scheduled to run later.
On Fri, Nov 19, 2021 at 11:12 AM Paul Smith phhs80@gmail.com wrote:
On Fri, Nov 19, 2021 at 7:09 PM Joe Zeff joe@zeff.us wrote:
I am trying to run a script with the following command:
echo "~/scripts/teste.sh" | at 5:59PM
but nothing happens.
Try putting some echo commands into the script, redirected to a file so that you can see if the script runs at all, and if so, how far it gets.
Thanks, Joe. I am going to try that, but the following log may help to trace down the problem:
Nov 19 19:07:00 localhost atd[45259]: Starting job 110 (a0006e01a0663b) for user 'x' (1000) Nov 19 19:07:00 localhost audit[45259]: USER_ACCT pid=45259 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_localuser acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost systemd-logind[1147]: New session 17 of user x. Nov 19 19:07:00 localhost systemd[1]: Started Session 17 of User x. Nov 19 19:07:00 localhost atd[45259]: pam_unix(atd:session): session opened for user x(uid=1000) by (uid=0) Nov 19 19:07:00 localhost audit[45259]: USER_START pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost audit[45259]: CRED_ACQ pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_env,pam_localuser,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost atd[45263]: Exec failed for mail command: No such file or directory Nov 19 19:07:00 localhost audit[45259]: CRED_DISP pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_env,pam_localuser,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost atd[45259]: pam_unix(atd:session): session closed for user x Nov 19 19:07:00 localhost audit[45259]: USER_END pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost systemd[1]: session-17.scope: Deactivated successfully.
Paul _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Thanks, Clifford. No, they are not scheduled to start later -- I have just checked that with atq. Moreover, the log tells that the script is run at the specified time.
Paul
On Fri, Nov 19, 2021 at 7:19 PM Clifford Snow clifford@snowandsnow.us wrote:
Also check at -l, or atq to see if it is scheduled to run later.
I am trying to run a script with the following command:
echo "~/scripts/teste.sh" | at 5:59PM
but nothing happens.
Try putting some echo commands into the script, redirected to a file so that you can see if the script runs at all, and if so, how far it gets.
Thanks, Joe. I am going to try that, but the following log may help to trace down the problem:
Nov 19 19:07:00 localhost atd[45259]: Starting job 110 (a0006e01a0663b) for user 'x' (1000) Nov 19 19:07:00 localhost audit[45259]: USER_ACCT pid=45259 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_localuser acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost systemd-logind[1147]: New session 17 of user x. Nov 19 19:07:00 localhost systemd[1]: Started Session 17 of User x. Nov 19 19:07:00 localhost atd[45259]: pam_unix(atd:session): session opened for user x(uid=1000) by (uid=0) Nov 19 19:07:00 localhost audit[45259]: USER_START pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost audit[45259]: CRED_ACQ pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_env,pam_localuser,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost atd[45263]: Exec failed for mail command: No such file or directory Nov 19 19:07:00 localhost audit[45259]: CRED_DISP pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_env,pam_localuser,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost atd[45259]: pam_unix(atd:session): session closed for user x Nov 19 19:07:00 localhost audit[45259]: USER_END pid=45259 uid=0 auid=1000 ses=17 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="x" exe="/usr/sbin/atd" hostname=? addr=? terminal=atd res=success' Nov 19 19:07:00 localhost systemd[1]: session-17.scope: Deactivated successfully.
Paul _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
-- @osm_washington www.snowandsnow.us OpenStreetMap: Maps with a human touch _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Adding echo or print statements to a program or script for debugging is such an old technique that most people have either forgotten it or never learned it.
On 11/19/21 12:11 PM, Paul Smith wrote:
Nov 19 19:07:00 localhost atd[45263]: Exec failed for mail command: No such file or directory
If you want, you can add -M to the at command to suppress all mail and get rid of that.
Thanks, Joe. I put
echo xxx
in the second line of the script and nothing was printed.
The log mentions the creation of a new session, which is closed when (apparently) the execution of the script finishes.
Paul
On Fri, Nov 19, 2021 at 7:30 PM Joe Zeff joe@zeff.us wrote:
Adding echo or print statements to a program or script for debugging is such an old technique that most people have either forgotten it or never learned it.
On 11/19/21 12:11 PM, Paul Smith wrote:
Nov 19 19:07:00 localhost atd[45263]: Exec failed for mail command: No such file or directory
If you want, you can add -M to the at command to suppress all mail and get rid of that. _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
On Friday, November 19, 2021 1:04:44 PM EST Paul Smith wrote:
I am trying to run a script with the following command:
echo "~/scripts/teste.sh" | at 5:59PM
but nothing happens.
That's because there is no tilde expansion inside of quotes.
Lose the quotes and all will be well.
Thanks, Ulf and Garry.
Ulf seems to be right, as the following
echo "XAUTHORITY=/run/user/1000/gdm/Xauthority DISPLAY=:0 gxmessage "hello"" | at 7:52PM -M
while
echo "gxmessage "hello"" | at 7:52PM -M
does not.
Should I put
XAUTHORITY=/run/user/1000/gdm/Xauthority DISPLAY=:0
in the script? The syntax is correct?
Paul
On Fri, Nov 19, 2021 at 7:45 PM Garry T. Williams gtwilliams@gmail.com wrote:
On Friday, November 19, 2021 1:04:44 PM EST Paul Smith wrote:
I am trying to run a script with the following command:
echo "~/scripts/teste.sh" | at 5:59PM
but nothing happens.
That's because there is no tilde expansion inside of quotes.
Lose the quotes and all will be well.
-- Garry T. Williams
users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
On 19.11.21 19:04, Paul Smith wrote:
echo "~/scripts/teste.sh" | at 5:59PM
[...]
gxmessage -center \
gxmessage relays on an X11 display. You have none in a session started via atd.
Assuming, you are running gnome and your uid is 1000,
XAUTHORITY=/run/user/1000/gdm/Xauthority DISPLAY=:0 gxmessage ...
may work.
Best regrads Ulf
On 19Nov2021 20:42, Ulf Volmer u.volmer@u-v.de wrote:
gxmessage relays on an X11 display. You have none in a session started via atd.
You're confusing this with cron. At preserves your environment. If he's still logging into his X11 session this should work.
Cheers, Cameron Simpson cs@cskk.id.au
On 19.11.21 20:54, Cameron Simpson wrote:
On 19Nov2021 20:42, Ulf Volmer u.volmer@u-v.de wrote:
gxmessage relays on an X11 display. You have none in a session started via atd.
You're confusing this with cron. At preserves your environment. If he's still logging into his X11 session this should work.
Yes, agree, you are right.
Best regards Ulf
Fixed now! I had to put the following line in the script:
export DISPLAY=:0
Paul
On Fri, Nov 19, 2021 at 8:30 PM Ulf Volmer u.volmer@u-v.de wrote:
On 19.11.21 20:54, Cameron Simpson wrote:
On 19Nov2021 20:42, Ulf Volmer u.volmer@u-v.de wrote:
gxmessage relays on an X11 display. You have none in a session started via atd.
You're confusing this with cron. At preserves your environment. If he's still logging into his X11 session this should work.
Yes, agree, you are right.
Best regards Ulf
users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure