LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-25-2016, 08:53 PM   #1
FrizzledOldButt
Member
 
Registered: Dec 2015
Posts: 129

Rep: Reputation: Disabled
bash script symlinked in rc0.d doesn't execute


I have a VERY simple bash script that I want to sent an instruction to another PC on the LAN on shutdown.

The script itself works fine when called from the command line.

My understanding is that the script should be saved in /etc/init.d and then sym linked in /etc/rc0.d -which I have done. I have called the symlink /etc/rc0.d/K01chkserver

The symlink executes OK from the command line. No errors.

However, the script never executes on shutdown.

Any clues as to what I am doing wrong.

Last edited by FrizzledOldButt; 06-25-2016 at 09:01 PM. Reason: syntax correction
 
Old 06-25-2016, 10:16 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Usual reason is it works in root or user environment because commands are found on $PATH.
 
Old 06-25-2016, 10:19 PM   #3
FrizzledOldButt
Member
 
Registered: Dec 2015
Posts: 129

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Emerson View Post
Usual reason is it works in root or user environment because commands are found on $PATH.
I'm including the explicit (/usr/bin) path in commands.
 
Old 06-25-2016, 10:24 PM   #4
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Don't know then. Is this a systemd setup? It may even not execute anything in /etc/rcX.d.
 
Old 06-29-2016, 02:50 AM   #5
FrizzledOldButt
Member
 
Registered: Dec 2015
Posts: 129

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Emerson View Post
Don't know then. Is this a systemd setup? It may even not execute anything in /etc/rcX.d.
That was it <grrrr>

Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute bash script in C waqasdaar Programming 15 10-27-2015 02:54 PM
[SOLVED] execute bash script from pySide script sharky Programming 3 12-23-2013 01:49 PM
Can't execute Bash script. zbe Linux - Software 4 10-17-2008 08:05 AM
Script doesn't execute in crontab jis0501 Linux - General 2 08-04-2007 07:09 AM
My samba netlogon script doesn't execute colpaarm Linux - Software 1 07-25-2003 09:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration