Question about bash scripting for Jessie

Need help with C, C++, perl, python, etc?

Re: Question about bash scripting for Jessie

Postby cronoik » 2015-08-25 22:39

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!
cronoik
 
Posts: 225
Joined: 2015-05-20 21:17

Re: Question about bash scripting for Jessie

Postby dasein » 2015-08-26 12:24

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.
User avatar
dasein
 
Posts: 7775
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Question about bash scripting for Jessie

Postby DFC302 » 2015-08-26 18:13

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!
DFC302
 
Posts: 4
Joined: 2015-08-07 19:13

Re: Question about bash scripting for Jessie

Postby GarryRicketson » 2015-08-26 19:16

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.
"What we expect you have already Done"

Before doing anything, read the Debian documentation:
Debian Documentation
How to ask the smart way
Debian Foro Español
======================
For the Birds
User avatar
GarryRicketson
 
Posts: 4463
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Question about bash scripting for Jessie

Postby dasein » 2015-08-26 19:39

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
dasein
 
Posts: 7775
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Question about bash scripting for Jessie

Postby GarryRicketson » 2015-08-26 20:12

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.
"What we expect you have already Done"

Before doing anything, read the Debian documentation:
Debian Documentation
How to ask the smart way
Debian Foro Español
======================
For the Birds
User avatar
GarryRicketson
 
Posts: 4463
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Question about bash scripting for Jessie

Postby DFC302 » 2015-08-26 20:15

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
DFC302
 
Posts: 4
Joined: 2015-08-07 19:13

Re: Question about bash scripting for Jessie

Postby GarryRicketson » 2015-08-26 20:25

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.
"What we expect you have already Done"

Before doing anything, read the Debian documentation:
Debian Documentation
How to ask the smart way
Debian Foro Español
======================
For the Birds
User avatar
GarryRicketson
 
Posts: 4463
Joined: 2015-01-20 22:16
Location: Durango, Mexico


Return to Programming

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable