Name
Shouldn't it be better to assign the value of the name variable manually instead of receiving the name of the script???. Because in Ubuntu the first time the script is runned by the system it appends the prefix S/Kxx to the pid file, causing commands start, stop and status to fail, it took me a while to figure out what was going on with the script.
name=basename $0
name="appname"
Thanks for your template, it is such a help for newbies. (y)
i had same problem! thanks for both template and reporting this issue.
hahhhh that fixed my service myapp status start stop command
thank you @hinantin
I had the same problem on centos.