LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 07-30-2009, 10:00 AM   #61
soupnsandwich
Member
 
Registered: Jul 2009
Location: State of Rhode Island
Distribution: TBA
Posts: 34

Original Poster
Rep: Reputation: 15

Quote:
This does not make sense to me. You would never have to prompt for root pass when your talking about an already install system.
No the system after install will force the root user to change the default password after install. This way there aren't machines out there that have the default root password...they MUST change it to something other than the one we set at our shop by default. It totally not relevant to this issue and the only reason why I mentioned it was to hopefully give you more of an idea about how the systems work. I thought it may be important to tell you that so we don't set the users name here...that's done on the retail side. Ya know, just encase it might have something to do with the cron job issue and the way we may have to pull user names from the system.

Quote:
Soup would you mind explaining the complete goal and function of you application? cron is one thing but we are now talking about many things.
Yeah sure. It's as I mentioned from the beginning. I simply need to have the cron job run once a day. As posted in my previous posts, the script that i'm running will be triggered by cron once a day. That script will check a URL on our site for a particular file. If that file exist then the script will run the "notify-send" and "zenity" commands notifying the end user with a popup message and a tray icon that there is a notification about their computer. When they click on the tray icon it brings them (with the browser) to our "Notification page" and that's all.

This script currently runs with a global autostart (/usr/share/Autostart) so when the machine runs for the first time it runs the script. However if a user never turns the computer off, it will never get the chance to run that script and that what cron is for. To run the script once a day.

I hope that help you. The goal still is the same. Run my script and have it's graphical messages show up on all users Desktops.

soup

Last edited by soupnsandwich; 07-30-2009 at 12:05 PM.
 
Old 07-30-2009, 12:21 PM   #62
soupnsandwich
Member
 
Registered: Jul 2009
Location: State of Rhode Island
Distribution: TBA
Posts: 34

Original Poster
Rep: Reputation: 15
I don't understand why we have to jump through hoops to get this to work. I must have found more than 10 sites/forums posting on Ubuntu and other sites and forums that people are doing exactly what I'm trying to do with little effort. Check this out.

I've tried lots of different ways to get this to work according to all these sources and none of them work.

http://dambalah.com/2009/06/04/using...rained-muscle/

http://ubuntuforums.org/showthread.p...highlight=cron

http://ubuntuforums.org/archive/index.php/t-105250.html

soup

Last edited by soupnsandwich; 07-30-2009 at 12:28 PM.
 
Old 07-30-2009, 07:59 PM   #63
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
soupnsandwich: There are more hoops for the OP's thread because he can't make assumptions about which desktop environment is used, can't assume that only one user is logged into computer, can't assume that the user's terminal is local, and can't configure the users Xorg access configuration behind their back, as xhost would do.

This line could be used to pass the xauth cookie from the user to root:
Code:
/bin/su $USER  -c "/usr/bin/xauth extract - $DISPLAY" | /usr/bin/xauth merge -
The USER and DISPLAY variables can be extracted from a process's environment. The trick is figuring out what process to look for if you can't make assumptions on which desktop environment the user is running.

Perhaps "ps -u $USER" to collect the PIDs, and then looking at the environment of more than one process, extracting the USER and DISPLAY, sorting, and then running the list through `uniq' so that there are no repeated USER/PID pairs. Remember that a logged in user may not be using X at all.

After all of the needed information is gathered, and your variables set.
 
Old 07-31-2009, 01:08 AM   #64
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Quote:
the system after install will force the root user to change the default password after install. This way there aren't machines out there that have the default root password...they MUST change it to something other than the one we set at our shop by default.
soup when I asked about the application I meant as a whole not the thread topic. Sounds like you are setting up computers with Linux and distributing them or selling them?

I think this thread is solved as jschiwal and I have pointed out there are many variables involved and discussed here. I hope the issues discussed are at least a starting point.

Once again to sum it up cron is not your problem soup it's being able to run apps in other users X sessions. The only way I was able to do this is by finding out who is logged in and get the display # and get the auth cookie and then run an x app.

Last edited by micxz; 07-31-2009 at 01:21 AM. Reason: spellin
 
Old 08-01-2009, 08:48 AM   #65
soupnsandwich
Member
 
Registered: Jul 2009
Location: State of Rhode Island
Distribution: TBA
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks you guys very very much.
I truly appreciate your time and efforts. I think you guys have provided me with plenty of information to get this to work correctly.
After enough testing now I'm sure that cron isn't the issue. It's simply the scripts that I'm trying to run.
The debugging script along with a simple command (play /usr/share/sounds/soundfilehere.wav) really help me track down what was going on and how cron works.

Thanks guys for all your help! I'll keep working on the scripts themselves and work through the madness.

Soup
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron job doesnt work, it works manually scofiled83 Programming 8 05-30-2009 03:12 PM
Why my cron job doesn't work byng08 Linux - Newbie 7 11-26-2008 01:17 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
How do I get a cron job to work? socceroos Linux - Software 2 03-23-2006 04:22 PM
Cron Job petenyce Linux - Newbie 5 10-11-2005 04:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 04:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration