can't use "service start servicename" to manage a service

HI, all:

I have set up a new linux server with gentran services on it. On the old server, there is an script called "service" under /sbin I could use to manage all service. I can run the commands like below to manage different service.

[root@luna sbin]# history | grep service
  108  /sbin/service denyhosts status
  109  /sbin/service denyhosts stop
  123  /sbin/service denyhosts status
  124  /sbin/service denyhosts start
  300  history | grep service
  301   /sbin/service gentran stop
  330  /sbin/service gentran status
  331  /sbin/service gentran start
  332  /sbin/service gentran restart
  531  /sbin/service gentran start
  537  /sbin/service denyhosts status
  538  /sbin/service denyhosts stop
  539  /sbin/service denyhosts start
  547  /sbin/service denyhosts stop
  548  /sbin/service denyhosts status
  549  /sbin/service denyhosts start
  581  /sbin/service gentran start
  583   /sbin/service gentran stop
  619  /sbin/service gentran start
  648  /sbin/service gentran stop
  649  /sbin/service gentran start
  655  /sbin/service gentran start
  754  /sbin/service gentran start


After I set up the new server, I copied this "service" script to the new server (it's quite strange, there is a script with the same name under /sbin folder, I backuped the old one and copied the new one into this folder). However, when I issued the same commands on this new server, it doesn't work at all. Did I miss some packages which are needed by this "service" script, I am coping the script here, please advise.
service
Jason YuAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

savoneCommented:
What flavor of Linux are you using?  The service script should not have to be copied, it exists on most Linux systems.
0
serialbandCommented:
Are you sure you have gentran installed correctly?  Did it put a script in init.d for the service command to start and stop?
0
Jason YuAuthor Commented:
No, for some unknown reason, I don't see a service named "gentran" under /etc/rc.d/init.d. How should I remedy this?

Thanks.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

ThomasMcA2Commented:
I would undo what you did to the "service" scripts. That script is provided by the distro. Unless both servers are the exact same distro and exact same version with the exact same patches installed, the copied script is likely different from the original script, and causing more problems than it solves.

So put the original service script back, run it, then reply back with any errors that it returns.
0
Jason YuAuthor Commented:
Hi, Thomas:

Thanks for your reply, I am glad I can get help even during weekends. Fortunately, I made a copy of the original script and will reverse the original one.

I will update once I am done.

thanks.
0
Jason YuAuthor Commented:
I reversed it back to the original one.

Here are the output when I ran the following commands.

[root@thea sbin]# ./service gentran status
gentran: unrecognized service
[root@thea sbin]# ./service gentran stop
gentran: unrecognized service
[root@thea sbin]#

Was it something wrong with IBM gentran software installation? This software is hard to install, I hope everything is fine with it.

thanks.
0
serialbandCommented:
If you don't see a script in init.d, then you can't run the service command.  That script typically finds a service by that name in init.d.  This suggest that your gentran service may not have been installed correctly.

How did you install the gentran?  Do you have that service installed correctly on the old server?  Do you see gentran in init.d on the old server?  Have you followed the instructions in the installation manual?

Is this the manual you followed? http://public.dhe.ibm.com/software/commerce/doc/sb2bi/gis42/GIS42_Installation.pdf

The manual seems quite involved, so you should double check that you haven't missed any details during the install.  I actually didn't find any mention of a service being created for gentran, so I'm unsure if someone created the gentran entry in init.d.  You should check the contents to see if that was installed via the IBM install steps or if someone manually created it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jason YuAuthor Commented:
Hi, all, thank you guys for your replies. I got the solution now.

there is a script called gentran under /etc/rc/d/init.d/gentran, inside this script, it calls the inbuilt commands to start and stop the services. After I copied this script from our production server to the test server, I can run the "/sbin/service start gentran " now.

What are the files under /etc/rc.d/init.d for? Why I need a script with the service name as the file name inside this folder to make "/sbin/service gentran start" to work.

Please advise, thank you very much.
0
Jason YuAuthor Commented:
I noticed I also need update the sudoer file as below: what is the relationship between /sbin/service and /etc/init.d/*

## Allows members of the users group to shutdown this system
# %users  localhost=/sbin/shutdown -h now
gentran         ALL=NOPASSWD: /sbin/service, /etc/init.d/gentran
0
serialbandCommented:
init.d is where the service scripts live.

/sbin/service is the command that uses them.

The sudoers file just limits the command that you can run as the gentran user when you sudo.
0
Jason YuAuthor Commented:
Thank you, since I already got this issue solved, I will close this case, thank you all.
0
Jason YuAuthor Commented:
Serialband and other experts:

Thank you for helping me get the solution so quick, I am glad I am a member of this community.

Have a nice week1

Jason
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.