FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 12-07-2009, 07:02 PM
"Joseph L. Casale"
 
Default how to do startup scripts?

>any suggestion?
>I've looked around about none interactive shells and so on.. so if I did a symbolic link from bamboo.sh script to /etc/init.d would that work?
>what about variables inside the script would they b read ?

Well, you can add an entry for that shell script to rc.local (unsexy).

Open a copy of an existing init script, and start hacking (sexy).

Wait till rhel moves away from that archaic sys v like stuff into a more intelligent
system like smf (super lusty) but that might be a while

jlc
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-07-2009, 07:02 PM
James Hogarth
 
Default how to do startup scripts?

Depending on the script placing it in /etc/init.d could work (with appropriate symlinks to /etc/rc.x) however does the script follwo standard behaviour for /etc/init.d scripts? (eg start, stop, restart, status.....) ....


If you just want the script/java file called you could just pop it into /etc/rc.local to run at the end of the start up sequence (you might need to & to background it) ... with the reminder that it will only run at startup then. To run it at other times you would need nohup <scriptname> &


that would prevent it ending when you log out or you close a terminal window (thus exiting the parent shell).

2009/12/7 Roland Roland <R_O_L_A_N_D@hotmail.com>






Hello,
*
I've just finished installing Atlassian's bamboo

it comes with two ways to start it up one through a
bash shell script bamboo.sh
and another through _javascript_ (this one is better
as it has the ability to start up the service if it got shutdown for any
reason)
*
so I'm wondering how can I set this service to
start on boot..
I know how to set a script on login in my profile
though not on boot..
*
any suggestion?
I've looked around about none interactive shells
and so on.. so if I did a symbolic link from bamboo.sh script to /etc/init.d
would that work?
what about variables inside the script would they b
read ?
*
obviously a newbie here so appreciate any detailed
explanation if possible about interactive/ none interactive shells and of course
if theres an advice about how to solve this issue..
*
PS: trying to educate myself about linux along the
way so any explanation would be greatly appreciated...
*
*
*

_______________________________________________

CentOS mailing list

CentOS@centos.org

http://lists.centos.org/mailman/listinfo/centos




_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-07-2009, 07:10 PM
John R Pierce
 
Default how to do startup scripts?

Roland Roland wrote:
> Hello,
>
> I've just finished installing Atlassian's bamboo
> <http://www.atlassian.com/software/bamboo/>
> it comes with two ways to start it up one through a bash shell script
> bamboo.sh
> and another through java script (this one is better as it has the
> ability to start up the service if it got shutdown for any reason)
>
> so I'm wondering how can I set this service to start on boot..
> I know how to set a script on login in my profile though not on boot..
>
> any suggestion?
> I've looked around about none interactive shells and so on.. so if I
> did a symbolic link from bamboo.sh script to /etc/init.d would that work?
> what about variables inside the script would they b read ?
>
> obviously a newbie here so appreciate any detailed explanation if
> possible about interactive/ none interactive shells and of course if
> theres an advice about how to solve this issue..
>
> PS: trying to educate myself about linux along the way so any
> explanation would be greatly appreciated...

you need to write a script for /etc/init.d that takes an argument
"stop", "start", and optionally "restart" and/or "reload".

this script can either call that bamboo.sh script or just contain a copy
of it as the 'start' part (I'd go with the latter if its really simple)

do remember, you have to set up any environment this process may needmay
need. DO NOT ASSUME ANY LOGIN ENVIRONMENT.

Take a look at /etc/init.d/smartd as an example init script, as this is
a fairly simple one.

your script should have a comment on top something like...

#!/bin/sh
#
# bamboo Starts the bamboo service
#
# chkconfig: 345 05 95
# description: blahblah blahdablah blah
# ....

the important line there is chkconfig: whihc in this case says, by
default you want this service run at run levels 3,4,5, and it is to be
started at priority 05 and stopped at priority 95
(lower means sooner ni the order of things)

after putting that script in /etc/init.d, then...

service bamboo {start|stop}

will manuallly start/stop this service, and

chkconfig bamboo on

and that will configure it to run at startup per those chkconfig options.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-07-2009, 07:22 PM
"Gary L. Greene, Jr."
 
Default how to do startup scripts?

On Monday 07 December 2009 12:10:50 pm John R Pierce wrote:
> Roland Roland wrote:
> > Hello,
> >
> > I've just finished installing Atlassian's bamboo
> > <http://www.atlassian.com/software/bamboo/>
> > it comes with two ways to start it up one through a bash shell script
> > bamboo.sh
> > and another through java script (this one is better as it has the
> > ability to start up the service if it got shutdown for any reason)
> >
> > so I'm wondering how can I set this service to start on boot..
> > I know how to set a script on login in my profile though not on boot..
> >
> > any suggestion?
> > I've looked around about none interactive shells and so on.. so if I
> > did a symbolic link from bamboo.sh script to /etc/init.d would that work?
> > what about variables inside the script would they b read ?
> >
> > obviously a newbie here so appreciate any detailed explanation if
> > possible about interactive/ none interactive shells and of course if
> > theres an advice about how to solve this issue..
> >
> > PS: trying to educate myself about linux along the way so any
> > explanation would be greatly appreciated...
>
> you need to write a script for /etc/init.d that takes an argument
> "stop", "start", and optionally "restart" and/or "reload".
>
> this script can either call that bamboo.sh script or just contain a copy
> of it as the 'start' part (I'd go with the latter if its really simple)
>
> do remember, you have to set up any environment this process may needmay
> need. DO NOT ASSUME ANY LOGIN ENVIRONMENT.
>
> Take a look at /etc/init.d/smartd as an example init script, as this is
> a fairly simple one.
>
> your script should have a comment on top something like...
>
> #!/bin/sh
> #
> # bamboo Starts the bamboo service
> #
> # chkconfig: 345 05 95
> # description: blahblah blahdablah blah
> # ....
>
> the important line there is chkconfig: whihc in this case says, by
> default you want this service run at run levels 3,4,5, and it is to be
> started at priority 05 and stopped at priority 95
> (lower means sooner ni the order of things)
>
> after putting that script in /etc/init.d, then...
>
> service bamboo {start|stop}
>
> will manuallly start/stop this service, and
>
> chkconfig bamboo on
>
> and that will configure it to run at startup per those chkconfig options.
>
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>

Good documentation for this lives in the following directory:

/usr/share/doc/initscripts-<VERSION>/sysconfig.txt

The <VERSION> should be replaced with the version string of the initscripts
rpm found by running 'rpm -q initscripts --format %{VERSION} && echo' at the
terminal.

--
Gary L. Greene, Jr.
IT Operations
Minerva Networks, Inc.
Cell: (650) 704-6633
Phone: (408) 240-1239
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-07-2009, 07:22 PM
Les Mikesell
 
Default how to do startup scripts?

Roland Roland wrote:
>
> I've just finished installing Atlassian's bamboo
> <http://www.atlassian.com/software/bamboo/>
> it comes with two ways to start it up one through a bash shell script
> bamboo.sh
> and another through java script (this one is better as it has the
> ability to start up the service if it got shutdown for any reason)
>
> so I'm wondering how can I set this service to start on boot..
> I know how to set a script on login in my profile though not on boot..
>
> any suggestion?
> I've looked around about none interactive shells and so on.. so if I did
> a symbolic link from bamboo.sh script to /etc/init.d would that work?
> what about variables inside the script would they b read ?
>
> obviously a newbie here so appreciate any detailed explanation if
> possible about interactive/ none interactive shells and of course if
> theres an advice about how to solve this issue..
>
> PS: trying to educate myself about linux along the way so any
> explanation would be greatly appreciated...

Others have covered the init script conventions, so I'll just suggest
looking at Hudson (http://hudson-ci.org/) as a free alternative that you
can get RPM-packaged or just drop the war file under the stock Centos
tomcat.

--
Les Mikesell
lesmikesell@gmail.com

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 03:35 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org