473,386 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

automatic startup shell script

shahjapan
Hello,

I want to start a server at the linux system boot up (UBUNTU 7.04 )

I have used start-stop-daemon command in my shell script for that.

I have written my shell script path in /etc/rc.local file.

its working.


but I want to add the parameters of my program like port no of my application.

but I dont know how to pass the parameters to the application when using it with start-stop-daemon command.
Jul 6 '07 #1
3 5878
prn
254 Expert 100+
Hi shahjapan,

Basically, this is all going to depend on how you pass parameters to the daemon when you start it manually. Check that out, then look at the script in rc.local and modify whatever needs modifying. Knowing nothing more than you have told us, I can't really anwwer in any more detail, but that's basically what I would do in any case.

HTH,
Paul
Jul 9 '07 #2
Hi shahjapan,

Basically, this is all going to depend on how you pass parameters to the daemon when you start it manually. Check that out, then look at the script in rc.local and modify whatever needs modifying. Knowing nothing more than you have told us, I can't really anwwer in any more detail, but that's basically what I would do in any case.

HTH,
Paul
for example you can take postgreSQL server with port no if wetry it using start-stop-daemon command then how to pass the parameters with the following command.....

start-stop-daemon postgresql -p 5431 start
Jul 14 '07 #3
prn
254 Expert 100+
Hi shahjapan,

Sorry I hadn't got back to you. I've been sick for the last couple of days and not looking at this forum. :(

I think we're talking about several different things here.

I don't have an Ubuntu (or other Debian) system here to comment on, but I can describe how things work on some other kinds of system and you may be able to adapt from that.

On any unix-like system, there are a lot of daemons, so we need to be careful about which one we are talking about at any given time.

What you are apparently trying to do is to start your postgreSQL (daemon/server) and pass it a port number as you do, correct?

In order to do this, you have written a script and placed it in rc.local. Have you looked at the other scripts in rc.local? My guess is that this is the first and only script in rc.local, so you should look at other scripts in rc*.d to see how they work.

What I suspect you will find is the start-stop-daemon is NOT invoked from those scripts. Rather those scripts are what start-stop-daemon runs, at least that is how the equivalent works on other systems (e.g., Fedora, Solaris, etc.). That is, the startup procedure goes through the appropriate rc directories and runs the various startup scripts that it finds there. THOSE scripts set the parameters for the various servers (daemons) that are started this way. (Often by starting the servers using a config file.)

For example, a typical startup script, such as /etc/rc.d/rc3.d/K36mysqld (which is actually a symlink to /etc/rc.d/init.d/mysqld) will then check the command line by which it was called, determine from that whether it was supposed to start, stop, restart, etc. and then do the right thing. If it is supposed to start the mysql server, it points the server to the appropriate configuration file. In other cases, the server daemons are started by passing them parameters directly.

Pick a script among your init scripts and see how parameters are passed to the servers in them.

HTH,
Paul
Jul 18 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Lynn | last post by:
I'm running Oracle 8.1.7.4.1 on W2K and have the services for my oracle instances set to automatically startup and shutdown with the W2K server. Unfortunately, neither is working. Nothing gets...
0
by: Duane Winner | last post by:
Hello all - I'm having a small problem with the mysql startup script that ships with MySQL-3.23.56-1. I'm running on RedHat Linux. It works fine, but I have a backup server that runs a script...
8
by: John | last post by:
Hi, I'm using mysql-server-3.23.58-4 on a Linux (Fedora 1) machine. After reading the security section of the manual from http://dev.mysql.com, I added passwords for the 'root' accounts. ...
9
by: Harry Smith | last post by:
While reading the documentation on IsStartupScriptRegistered, there is a reference to "client startup script" as "Determines if the client startup script is registered with the Page object." What...
1
by: Iulian | last post by:
Hi, I am working on a directory type of site and I got stuck in the following problem: when the user clicks on the download link I present a page that sais: "Contacting download site... If the...
1
by: Locke Nash Cole | last post by:
I'm making a utility similar to MSConfig, I've found it easy enough to obtain the startup items from the registry for the current user and local machine... but what about the Startup folder on the...
4
by: Larry | last post by:
I have a Perl script using DBD::DB2, that runs during system startup on a Solaris system. The script is working fine during startup on many machines, except on one machine it fails complaining...
7
by: Peter S. | last post by:
I currently have created a C# program that automatically updates an SQL database once everyday. It's an application that I manually start. I want make it so that if the (Windows 2003) server...
0
by: Norm | last post by:
Has anyone created an elegant way to automate database activation on instance startup? I come across a number of client sites that have DB2 installed because it was sold embedded with another...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.