LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-20-2013, 04:14 PM   #1
PierreB.
Member
 
Registered: Apr 2012
Location: Grenoble
Distribution: Rhel[456],CentOS[56],fedora18
Posts: 33

Rep: Reputation: Disabled
Launch a text program inside a konsole at startup


Hi LQ'ers,

I am trying to setup a (very) simple startup script on a centos 6.4 computer and it kind of failed.... Here are the details :

As said just above the computer setup is running a CentOS 6.4 x64, on this computer a vncserver is automatically started (by a chkconfig vncserver on), i use this vncserver to remotely access the computer and to run ktorrent too.
This setup worked very well for the last 3 years (upon different Fedora based distros).

I have to use rtorrent for some private tracker, i then would like to make it (rtorrent) startup automaticallyjust like ktorrent.

I wrote a little piece of script to achieve what i thought to be a simple and quick task, BUT, it doesn't work.

I created a new user (called rtorrent_user) to run rtorrent app, i also setup a sudo to allow the vncserver user to run rtorrent app as rtorrent_user.

When i launch the script from a konsole everything works, but when i setup the script for an automatic startup (symlinking manually or using the CentOS GUI) the script ran but no konsole+rtorrent appears...

If you have an idea ???


Here is the script :
Code:
#!/bin/bash

# Start rtorrent automatically when vncserver start for user "pier"
# add rtorrent to the X server "access control list" :
wall "launched"
xhost + SI:localuser:rtorrent
# Now start rtorrent from inside a "konsole" (the following requires a correct sudoers file) :
konsole -e sudo -u rtorrent konsole -e rtorrent
The wall command allow me to ensure the script was really launched at startp, and it did but nothing happened after....

Last edited by PierreB.; 04-20-2013 at 04:32 PM. Reason: typo
 
Old 04-21-2013, 02:10 PM   #2
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch
Posts: 421

Rep: Reputation: 18
Quote:
Originally Posted by PierreB. View Post
Hi LQ'ers,
Code:
konsole -e sudo -u rtorrent konsole -e rtorrent
The wall command allow me to ensure the script was really launched at startp, and it did but nothing happened after....
If konsole is like xterm, I believe you can have only one -e option, which must be the last option
 
Old 04-21-2013, 03:14 PM   #3
PierreB.
Member
 
Registered: Apr 2012
Location: Grenoble
Distribution: Rhel[456],CentOS[56],fedora18
Posts: 33

Original Poster
Rep: Reputation: Disabled
Hi porphyry5,

Thank you for taking time to answer me.

I am sure you are right about the -e konsole options, and actually i was trying to launch one konsole instance and then from this first instance sudo'ing to another user to launch the second konsole in which rtorrent should be ran...

Way to complicated, as i was not able to achieve this, i simplified the problem by using only one user.

But i still can't get it works... I am now just trying to launch a konsole to which i pass rtorrent as a command to run, but still no luck, the issue is now for me to make rtorrent to get the required parameters to run as i expect it to run, but this is another story.

Once i will fix this rtorrent issue i'll try to launch the konsole at startup with the rtorrent argument to the -e option and see if it runs.


I'll come back here to give some (good?) news about my progress.
 
Old 04-21-2013, 03:45 PM   #4
PierreB.
Member
 
Registered: Apr 2012
Location: Grenoble
Distribution: Rhel[456],CentOS[56],fedora18
Posts: 33

Original Poster
Rep: Reputation: Disabled
Ok, so i finally fix this the best way : just added a
Code:
konsole --workdir /path/to/dir -e rtorrent
, and that's it...

Thanks for your support.
 
  


Reply

Tags
konsole, rtorrent, startup


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Cannot launch konsole from Mate's panel or desktop CollieJim Linux Mint 1 12-04-2012 04:29 PM
[SOLVED] launch gnome-terminal inside a script and inherit variables and functions... masavini Programming 1 09-13-2012 07:47 AM
[SOLVED] How can I launch a process which I will define its stdin from inside my application aslangul Programming 1 09-24-2010 07:53 AM
How to launch a program as a defined user at startup. Linux.tar.gz Linux - Software 2 03-20-2005 11:28 AM
Gtk-Warning but program still works... I close konsole, program closes Laptop2250 Linux - Software 2 11-14-2003 11:18 PM


All times are GMT -5. The time now is 05:48 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration