startup script not working
I made a startup script to automatically start MySQL Daemon on startup. However, for some reason it's not working on a restart (but if I call it manually with the "start" option it works).
I used "who -r" to confirm my default run level is 5, and I put the script in /etc/init.d/mysqlds and I link to it from rc5.d with the name: S24mysqlds --> ../mysqlds The only odd thing I can note is that when I run the script manually, it doesn't return to the command prompt until I hit the enter key. Any ideas why this isn't bringing up the mysql server on the restart? Here's the script (my password replaced with asterisks). Maybe the problem is permissions. I set it to -rwx------ so the password is not readable, but I would have thought booting occurs with root privileges. Code:
#!/bin/sh |
You only need one case statement. I don't think you want '*' after each option (I've never seen this). You also probably want to put double quotes around your ${1}. Also, why are you writing a script when one comes w/ mysql?
Try: Code:
#!/bin/sh HTH Forrest p.s. I didn't mean to imply that the '*' in a case statement wasn't valid, only that you don't need to match on start* and stop*. |
Not an assignment, this really is a script I threw together real quick by copying another script and editing it a bit. I was kind of in a rush.
I'll try the official script when I have a chance, thanks for the link. |
In case it's any help, the { and } in "${1}" are unnecessary and there's a typo in
Code:
echo $"Usage: $0 {start|stop}" |
The echo line was copied directly from the mysql.server script on my system (and then the other options were then removed), but the line works on my system even with the $ (although I don't know if it was put there on purpose or not. Also, I know the { and } are unnecessary, but they follow the style that the OP was using for variable referencing (and is my preference as well, although I didn't change the $0 to ${0} in the copied line).
Forrest p.s. on further examination (I got curious), I've noticed that most of the "Usage" lines in my /etc/init.d scripts are 'echo $"Usage:...'. |
Quote:
|
Glad you pointed that out cause I've been hitting Google pretty hard w/ all kinds of 'bash echo $""' type queries (along w/ pounding my head on my desk).
Forrest |
Quote:
|
All times are GMT -5. The time now is 05:16 AM. |