How to close terminal window when launching app from command line
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to close terminal window when launching app from command line
Hi all,
I've created a couple of shell scripts (using sudo) and linked a desktop icon to them to allow my users to be able to launch 'root only' applications. Whenever it does this though a terminal session always stays open in another windows (if you press CTRL+C it will close the application).
Is there anyway to prevent this from happening and just have the application active?
Is there a simple way to do this? The users are fairly compute illiterate and quite simply would bitch and moan if any additional steps needed to be taken.
The icon on the desktop calls upon /usr/bin/pptp.sh which contains the following:
Code:
#!/bin/sh
sudo /usr/sbin/pptpconfig
The sudoers file allows the user to run this command only without a password. If i change the shell script to:
Code:
#!/bin/sh
sudo nohup /usr/sbin/pptpconfig
and add /usr/bin/nohup to the sudoers file, it allows the user to open the application up and close the terminal window without closing down the application.
If this can be automated to close down the terminal window when the program is launched it would be a great solution. I have tried appending | exit on to the end and putting exit in a new line in the shell script but it does not work.
That didn't work. When the desktop icon is double clicked a terminal window appears for a breif second and then closes without launching the application.
I may have a solution for you. I use under my Fedora 7 system and it permits me to close the xterm, yet leaving the pptpconfig front-end still running.
I may have a solution for you. I use under my Fedora 7 system and it permits me to close the xterm, yet leaving the pptpconfig front-end still running.
P.S. I setup my launcher to run as an "application" (not an "application in terminal").
Hi Dwhitney -
That worked However seeing as though my user doesn't need to enter a sudo password to run pptpconfig, is there a chance of modifying the command so it simply just launches?
Also I see your using /usr/bin/pptpconfig, I'm using /usr/sbin/pptpconfig - do you believe there are much differences here?
Until today, I was not aware of the alternate pptpconfig in /usr/sbin.
When I attempted to use it (as a non-root user), it launched, but my stored VPN contact information (which I had created earlier as root using the alternate pptpconfig) was not displayed. When I attempted to create a new contact, the application gave me an error indicating that it failed to open /etc/pptpconfig/lock and thus it could not save the information. The permissions of the lock file do not permit non-root users to write.
Can you please confirm what the settings are on your system's lock file and for the two versions of the pptpconfig applications?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.