Debian 10 GNOME how to run startup script on gnome-terminal?

New to Debian (Or Linux in general)? Ask your questions here!

Debian 10 GNOME how to run startup script on gnome-terminal?

Postby Chiefahol2 » 2019-05-15 06:41

After many attempts this is what i'm left with in my ordinary user account crontab:

@reboot sleep 60 && /usr/bin/gnome-terminal -- bash -c '/bin/sh /home/user/mount.sh

I am trying to run this shell script at boot but it does not appear. the gnome-terminal command runs fine in a terminal though. :?

What am i doing wrong? xP
User avatar
Chiefahol2
 
Posts: 79
Joined: 2016-08-06 22:49

Re: Debian 10 GNOME how to run startup script on gnome-termi

Postby Dai_trying » 2019-05-15 12:26

I don't know if it will make the difference, but I usually put all commands (including any delay) inside of the script so I just have one command to execute from the crontab, it makes it look cleaner and keeps all functionality in one file (the script) so that cron has just one job.
Dai_trying
 
Posts: 707
Joined: 2016-01-07 12:25

Re: Debian 10 GNOME how to run startup script on gnome-termi

Postby None1975 » 2019-05-15 13:04

Hello. You can check this.
User avatar
None1975
 
Posts: 901
Joined: 2015-11-29 18:23
Location: Lithuania, Vilnius

Re: Debian 10 GNOME how to run startup script on gnome-termi

Postby Head_on_a_Stick » 2019-05-15 14:34

Or this: http://0pointer.de/blog/projects/system ... ins-3.html

Running a "boot script" with gnome-terminal is just silly.
User avatar
Head_on_a_Stick
 
Posts: 10321
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Debian 10 GNOME how to run startup script on gnome-termi

Postby RU55EL » 2019-05-15 15:42

By using the .bashrc file?
User avatar
RU55EL
 
Posts: 401
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Debian 10 GNOME how to run startup script on gnome-termi

Postby Head_on_a_Stick » 2019-05-15 15:44

^ Anything in ~/.bashrc will be run every time a terminal session is started, which probably isn't what the OP wants.

~/.profile is read when the user logs in, which may be better.
User avatar
Head_on_a_Stick
 
Posts: 10321
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Debian 10 GNOME how to run startup script on gnome-termi

Postby tynman » 2019-05-15 19:20

Running a bash script with cron and @boot should be fine (although I confess I don't recall ever using it).

What am i doing wrong? xP


The problem is probably the use of gnome-terminal. The 60 second sleep is an attempt to make sure X is up? I'm not sure why it isn't working, but cron doesn't need a terminal it to run a bash script. I suggest try simplifying the cron event with just...

Code: Select all
@reboot sleep 60 && /home/user/mount.sh
tynman
 
Posts: 104
Joined: 2016-05-03 19:48
Location: British Columbia, Canada

Re: Debian 10 GNOME how to run startup script on gnome-termi

Postby RU55EL » 2019-05-15 23:06

RU55EL wrote:By using the .bashrc file?


Head_on_a_Stick wrote:^ Anything in ~/.bashrc will be run every time a terminal session is started, which probably isn't what the OP wants. [...]


Good point!
User avatar
RU55EL
 
Posts: 401
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Debian 10 GNOME how to run startup script on gnome-termi

Postby sickpig » 2019-05-15 23:24

i have abandoned cron for systemd, y? because i was born into debian with it.
and its quite easy also it lets u start gui apps which cron is incapable of doing.
msg here if you want to and i shall post example
haven = Sir P.G. Wodehouse's books. U havent lived unless u have read one :)
User avatar
sickpig
 
Posts: 314
Joined: 2019-01-23 10:34


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable