Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Question about bash scripting for Jessie

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
cronoik
Posts: 310
Joined: 2015-05-20 21:17

Re: Question about bash scripting for Jessie

#1 Post by cronoik »

You are probably using systemd (check it with ps --pid 1) and therefore /etc/init.d isn't considered for autostart. Here can you find some information about systemd and autostart [1]. As far as I know systemd isn't intended to start applications with systemd. I recommend you to use the autostart feature of your window manager or desktop environment or at least the .xinitrc.

[1] https://wiki.archlinux.org/index.php/Au ... ng#Systemd
Have a nice day!

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Question about bash scripting for Jessie

#2 Post by dasein »

DFC302 wrote:Could it be my script or something else?
It's "something else," broadly speaking.

You don't really want to start a browser instance at system startup. You want it to start it at user login.

That distinction isn't nearly as arbitrary as it might seem at first glance. Processes that get invoked at system startup are processes that need to be universally available in a user-independent way. Networking is a familiar and obvious example of something you'd want to have available even if no user is logged in, which is why low-level network services are invoked at system startup.

In contrast, processes that get invoked at login are tied to a specific user account and therefore are not started until and unless that user logs in. Pretty much by definition, just about any end-user app that you'd want to start automatically should be started at login, not startup.

As noted by cronoik, there are a number of methods available to autostart an application at user login, and many of those methods operate in a DE/WM-specific way. A quick Web search for autostart <name of your DE/WM here> ought to give you plenty of examples.

DFC302
Posts: 4
Joined: 2015-08-07 19:13

Re: Question about bash scripting for Jessie

#3 Post by DFC302 »

Awesome, thankyou guys. Yeah I want it to start at user now that you say that. That does make alot more sense. I know I can also use the autostart in settings like you guys mentioned, I just wanted to know also where scripts would be placed at to have them boot at a user login for future reference. Thank you for the replies and help so far!

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Question about bash scripting for Jessie

#4 Post by GarryRicketson »

daeisin> It's "something else," broadly speaking.
Lol,..yes it was "something else", broadly speaking, I did not notice at first.

This was the orginal post by, but with some changes, the urls were removed,and
the script put in code boxes, the stars **** indicate where I removed the company name
and url.
Postby DFC302 » 2015-08-25 15:48

So i made a bash script for my media server to start google-chrome and navigate to ***a site.*** I am really really new to scripting and just trying to learn. I never messed with Jessie before, but the problem I am having is that I want this script to run at start up. I searched around and found that I needed to put my script into /etc/init.d but even after a restart it still doesn't do anything. Could it be my script or something else? Heres a copy of my script:

Code: Select all

#! /bin/bash/

#Start google chrome and navigate to "***some web site***" 

google-chrome  ****some.website.url****

Maybe im missing something or it could just be that im a newb lol. Any help would be appreciated thanks.
Maybe I missed something, when I first saw this, but
I thought it was spam, just trying to get people to go to the advertisement.

However
it could just be that im a newb lol
or that is just a convenient
pretext, but it works.
The link to a commercial site was removed though.
The OP also should learn how to use the code boxes and use them, when posting scripts and code.
It would be a good idea to read this:
Forum guidelines. Please read before first post!
The following might get your post REMOVED
- Advertising/ Spamming
------------------------------------
Netflix is not even remotely related to debian, nor the topic, the topic appears to have been started just to advertise netflix.
Thank you
Last edited by GarryRicketson on 2015-08-26 20:26, edited 4 times in total.

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Question about bash scripting for Jessie

#5 Post by dasein »

For the record, that's why the domain example.com exists and is used widely in, well, examples of URLs. Per rfc 2606, it points to a "dummy" domain.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Question about bash scripting for Jessie

#6 Post by GarryRicketson »

That is a good option too, it may be that the poster is a "newbie", and just didn't know better, but that same kind of mistake is what gets people listed as spammers, and eventually banned on many sites. But anyway that is a different topic.

DFC302
Posts: 4
Joined: 2015-08-07 19:13

Re: Question about bash scripting for Jessie

#7 Post by DFC302 »

My intentions are not to advertise at all, sorry that that got misconstrued. I never been a part of a forum before and this is only my second post, sorry I didnt add the code into brackets as well. I really dont know how to edit this post, so if you have to I guess you can just delete it. Sorry for any inconvenience

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Question about bash scripting for Jessie

#8 Post by GarryRicketson »

No big deal, and thanks on the "apology", we all make mistakes when we are learning new things,...It is something to think about though, before posting links to anywhere,but again that is another topic,..I also apologize for thinking it was spam.

Post Reply