Bug 19027 - 6_s1: xmessage fails to run in root or cron jobs.
Summary: 6_s1: xmessage fails to run in root or cron jobs.
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: All Packagers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-22 20:57 CEST by Bit Twister
Modified: 2016-08-01 20:43 CEST (History)
1 user (show)

See Also:
Source RPM: xmessage???
CVE:
Status comment:


Attachments

Description Bit Twister 2016-07-22 20:57:26 CEST
Description of problem:

6_s1: xmessage fails to run in root cron jobs.

Email failure message:
/etc/cron.hourly/_hourly:
/local/cron/hourly/ck_mail_spool:
No protocol specified
xcb_connection_has_error() returned true

I have a common partition (/local) shared between all installs.
Install script creates links from /etc/cron* to /local/cron/*

In other words, if it works in /mga5(4,3,2,Mandriva) they should still work on cauldron.

Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
1. save following as test_case
2. chmod +x test_case
3. verify it works.
   ./test_case

4. Put it in /etc/cron.hourly with
             cp test_case /etc/cron.hourly
or link it   ln -sf $PWD/test_case /etc/cron.hourly/

5. two minutes after the hour you should have a pop up message or a failure message in root's mail box.

6. as root:       cat /var/mail/root

-----8<----8<----8<- cut below this line---8<----8<
#!/bin/bash
export PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
    export DISPLAY=:0
    export COLUMNS=80
    export LINES=24
    xhost +localhost:root  > /dev/null 2>&1
    xhost +localhost  > /dev/null 2>&1
    xhost +$(cat /etc/hostname)  > /dev/null 2>&1

    nohup xmessage "\
        # message from test_case.
        # when done:
        rm -f /etc/cron.daily/test_case
        " > /dev/null 2>&1 &
    sleep 2
#********* end test_case *******************************
Comment 1 David Walser 2016-07-22 22:25:08 CEST
Have you researched your error message:
"No protocol specified
xcb_connection_has_error() returned true"

and found anything about that?  I agree that based on your script you pasted, it should work.
Comment 2 Bit Twister 2016-07-22 23:44:26 CEST
(In reply to David Walser from comment #1)
> Have you researched your error message:
> "No protocol specified
> xcb_connection_has_error() returned true"
> 
> and found anything about that? 

Yep, that is how I found out about trying   +localhost:root.
Also compared/verified /etc/ssh/sshd_config and /mga5 were functionally the same.

> I agree that based on your script you pasted, it should work.

Yes, and this is a show stopper for me. As you can see I have a few scripts using it:

$ ls  /local/cron/hourly
ck_4_rpms      ck_mail_spool         clean_score      php.cron
ck_connection  ck_mythtv_storage     create_run_user  pull_updates
ck_ir_tuner    ck_systemctl_service  cron_perms       sys_audit

and same amount of scripts over in /local/cron/daily.

I even have xmessage alarms from other systems to get my attention.
Comment 3 Marja Van Waes 2016-07-24 09:14:20 CEST
Assigning to all packagers collectively, since there is no maintainer for xmessage. Please reassign if the culprit is a different package.

CC: (none) => marja11
Assignee: bugsquad => pkg-bugs
Source RPM: (none) => xmessage???

Comment 4 Bit Twister 2016-07-24 10:25:34 CEST
(In reply to Marja van Waes from comment #3)
> Assigning to all packagers collectively, since there is no maintainer for
> xmessage. Please reassign if the culprit is a different package.

I am pretty sure it is not a xmessage problem. My guess, root cause of bug 19038 or/and bug 19039 help resolve this bug.
Bit Twister 2016-07-24 10:26:19 CEST

Summary: 6_s1: xmessage fails to run in root cron jobs. => 6_s1: xmessage fails to run in root or user cron jobs.

Comment 5 Bit Twister 2016-07-24 12:05:08 CEST
Sorry about toggling the title. None of my user cron jobs had a condition needed to run xmessage. I created a false one and xmessage launched a pop up.

root cron jobs are still broke.

Summary: 6_s1: xmessage fails to run in root or user cron jobs. => 6_s1: xmessage fails to run in root or cron jobs.

Comment 6 Bit Twister 2016-08-01 20:43:28 CEST
Solution is to add the following to root cron jobs needing X11 access

 xhost +si:localuser:root

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.