[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 797
  • Last Modified:

Ubuntu linux : start script at starting

Hello experts
my question is really a very simple one
I need to start
/red5/red5.sh
when the server starts

What I did is:
I created a myscript using VI (it created some start(), stop() functions)
in
/etc/init.d

Is this ALL I have to do or did I miss something ?

#!/sbin/runscript
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {

}

start() {
/red5/red5.sh&
}

stop() {

}

restart() {

}

Open in new window

0
yarekGmail
Asked:
yarekGmail
  • 9
  • 8
  • 4
  • +5
1 Solution
 
Kamaraj SubramanianApplication Support AnalystCommented:
0
 
Kamaraj SubramanianApplication Support AnalystCommented:
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Fabio MarzoccaFreelancerCommented:
just add your script to /etc/rc.local
0
 
yarekGmailAuthor Commented:
1) I use SSH no graphic desktop
2) I ran:
# update-rc.d red5 defaults
-bash: update-rc.d: command not found
0
 
yarekGmailAuthor Commented:
and there is no

/etc/rc.local

on my ubuntu !

0
 
Fabio MarzoccaFreelancerCommented:
you should have /etc/rc.local  it is in all ubuntu server/desktop default installations
0
 
yarekGmailAuthor Commented:
cd /etc/rc.local
-bash: cd: /etc/rc.local: Aucun fichier ou répertoire de ce type

Which means : No files or directory with such name !

One cagain I do not have a DESKTOP ubuntu , only SSH
0
 
Fabio MarzoccaFreelancerCommented:
NO!

sudo gedit /etc/rc.local
0
 
Fabio MarzoccaFreelancerCommented:
or, if you have a server,

sudo nano /etc/rc.local

0
 
the_pitouCommented:
If you don't have update-rc.d or /etc/local, try to link your script in /etc/rcX.d/, where X is init level.
0
 
yarekGmailAuthor Commented:
etc # cd /etc
etc # ls rc*
rc.conf

THERE IS NO rc* in  /etc/  !!!
0
 
Fabio MarzoccaFreelancerCommented:
c'mon....

ls /etc | grep rc.local


0
 
yarekGmailAuthor Commented:
# ls /etc | grep rc.local
#

NOTHING !


Mybe this can help:

# cat /proc/version
Linux version 2.6.31.5-grsec-xxxx-grs-ipv4-64 (root@kernel-64.ovh.net) (gcc version 4.3.2 (Debian 4.3.2-1.1) ) #2 SMP Thu Nov 5 12:36:20 UTC 2009
/ # uname -a

Linux ns22372.ovh.net 2.6.31.5-grsec-xxxx-grs-ipv4-64 #2 SMP Thu Nov 5 12:36:20 UTC 2009 x86_64 Intel(R) Xeon(R) CPU W3520 @ 2.67GHz GenuineIntel GNU/Linux

I just wonder why it is so complex to run a script at runtime... Really hate linux for that !

0
 
Fabio MarzoccaFreelancerCommented:
Who said it is difficult? I am running scripts at runtime since 7 years ...
0
 
hemmiCommented:
What version of ubuntu? You did not mention it and right now ubuntu is heavily working on the startup.
What does
cat /etc/lsb-release say?
0
 
yarekGmailAuthor Commented:
well (to fmazocca) yes it is difficult ! Since we cannot do it !
cat /etc/lsb-release : error : No such file !

Here is the complete /etc listing !
etc # ls
adjtime                  crontab             fdprm           init.d             login.access       mke2fs.conf         nsswitch.conf   quotatab        skel           warnquota.conf
bash                     crontab.merged      filesystems     inittab            login.defs         modprobe.devfs      openldap        rc.conf         spamassassin   watchdog.conf
bind                     cron.weekly         freshclam.conf  inputrc            logrotate.conf     modprobe.devfs.old  opt             resolv.conf     ssh            webalizer.conf.hello
ca-certificates.conf     csh.env             fstab           iproute2           logrotate.d        modules.autoload.d  ovhm.db         rmt             ssl            webalizer.conf.sample
clamd.conf               default             ftpusers        issue              lynx.cfg           modules.conf        ovhrelease      rpc             sudoers        webmin
clamd.conf.bak.patchovh  dev.d               gensync         issue.logo         lynx.lss           modules.conf.old    pam.d           rsyncd.conf     sysctl.conf    wget
collectd.conf            devfs.d             gentoo-release  kdc.conf.example   mail               modules.d           passwd          runlevels       syslog-ng      xinetd.d
conf.d                   devfsd.conf         gpm             krb5.conf.example  mailcap            modules.devfs       passwd-         screenrc        t1lib          xml
courier                  DIR_COLORS          group           ld.so.cache        mail.rc            motd                portage         scsi_id.config  tcp.smtp
courier-imap             dispatch-conf.conf  group-          ld.so.conf         make.conf          mots                profile         securetty       tcp.smtp.cdb
cron.d                   env.d               host.conf       lilo.conf          make.conf.example  mtab                profile.env     security        terminfo
cron.daily               environment         hosts           lilo.conf.example  make.globals       mysql               proftpd         services        udev
cron.deny                eselect             hosts.bck       limits             make.profile       nanorc              protocols       shadow          updatedb.conf
cron.hourly              etc-update.conf     hotplug.d       locales.build      man.conf           networks            pwdb.conf       shadow-         vim
cron.monthly             exports             httpd           localtime          mime.types         nscd.conf           quotagrpadmins  shells          vpopmail

Open in new window

0
 
Fabio MarzoccaFreelancerCommented:
You have a VERY uncommon installation of ubuntu. No rc.local, no lsb-release. That's not standard and that's why you're having troubles.
0
 
Fabio MarzoccaFreelancerCommented:
i.e.: gentoo-release is NOT ubuntu!
lilo is not a standard ubuntu bootloader
your cat /proc/version doesn't even mention Ubuntu.

Are you sure you are running ubuntu??
0
 
hemmiCommented:
Who set this system up? It's not standard ubuntu (neither desktop nor server)! Don't blame linux for it.
What is
cat /etc/motd
? (at least that file exists ...)
0
 
yarekGmailAuthor Commented:
sorry fmazzocca
I was said it was ubunta and I think that you are right since there is Gentoo files inside /etc

So I think it is Gentoo
0
 
hemmiCommented:
What is
cat /etc/gentoo-release
?
0
 
Fabio MarzoccaFreelancerCommented:
this is not a Gentoo board.
0
 
yarekGmailAuthor Commented:
cat /etc/gentoo-release
Gentoo Base System version 1.6.14
0
 
hemmiCommented:
Now that we're sure about your linux flavor:

add whatever you want to start to the bottom of

/etc/conf.d/local.start

That file should exist.

Please check the output of the command line

rc-update -s default

It should have an entry for local.
0
 
Benny2605Commented:
the script will accept 3 grades, calculate an average and display a letter grade based upon the average. You will need to use either the if statement and/or the case statement to implement this script. I will verify that each pseudo step is addressed by executing your script/program.
0
 
PhobiaDHSCommented:
You can use Crontab to handle this to.

crontab -e

Enter on a new line:

@reboot /path/to/command/or/script

That might work for ya. I have it working on CentOS if that counts for much.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 9
  • 8
  • 4
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now