Re: What's the difference between /etc/init.d and /sbin/service

2009-04-20 Thread Bill Crawford
On Saturday 18 April 2009 19:21:30 Remi Collet wrote:
...
 You use want to use apache with php and Oracle.

 In your root environment you have all the stuff needed
 (mainly LD_LIBRARY_PATH, yes I know it's stupid, but it's Oracle)

 If you use /etc/init.d/httpd script apache will start.

 On next reboot it wouldn't because of missing environment ;)

SetEnv ORACLE_HOME ...
SetEnv LD_LIBRARY_PATH ...

in your apache config / vhosts file.

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: What's the difference between /etc/init.d and /sbin/service

2009-04-18 Thread Tom Horsley
On Sat, 18 Apr 2009 22:32:37 +0800
Nathan Huang wrote:

 I face a problem, What 's the difference between these two commands?

Nothing much, there just happens to be an assortment of different
ways to get service scripts going (which is, naturally, completely
different on different linux distros).

Direct invocation of /etc/init.d/ scripts is more likely to work on
many different distros, but even it doesn't always works as some
distros don't install the scripts with the execute bit turned on.

It is all part of the international conspiracy to make cross-distro
system administration as difficult as possible :-).

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: What's the difference between /etc/init.d and /sbin/service

2009-04-18 Thread Remi Collet
Le 18/04/2009 16:44, Tom Horsley a écrit :
 On Sat, 18 Apr 2009 22:32:37 +0800
 Nathan Huang wrote:
 
 I face a problem, What 's the difference between these two commands?
 
 Nothing much, 

I don't think so.

Main difference is environment which is clean before launch the
service by the service command.

Using service environment is closer to the one used during server boot
process (really different from interactive session)

One typical issue is environment variable need to start apache defined
in root interactive session and not during boot process.
(Such variable must be add to /etc/sysconfig/apache)

So please : don't use directly /etc/init.d/foo script

Remi.

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: What's the difference between /etc/init.d and /sbin/service

2009-04-18 Thread Craig White
On Sat, 2009-04-18 at 22:32 +0800, Nathan Huang wrote:
 Hi guys
 I face a problem, What 's the difference between these two commands?
 
 [miran...@charon ~]$ su -c '/etc/init.d/NetworkManager stop'
 
 [miran...@charon ~]$ |su -c '/sbin/service NetworkManager start 

assuming that the | character was a type and that you put a single quote
at the end of the second statement, the difference would be that the
first statement stops NetworkManager daemon and the second one starts
it.

/sbin/service $SOME_initscript_located_in_/etc/init.d/ and
/etc/init.d/$SOME_initscript are essentially the same

Craig


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: What's the difference between /etc/init.d and /sbin/service

2009-04-18 Thread Craig White
On Sat, 2009-04-18 at 23:15 +0800, Nathan Huang wrote:
 Craig White wrote:
  On Sat, 2009-04-18 at 22:32 +0800, Nathan Huang wrote:

  Hi guys
  I face a problem, What 's the difference between these two commands?
 
  [miran...@charon ~]$ su -c '/etc/init.d/NetworkManager stop'
 
  [miran...@charon ~]$ |su -c '/sbin/service NetworkManager start 
  
  
  assuming that the | character was a type and that you put a single quote
  at the end of the second statement, the difference would be that the
  first statement stops NetworkManager daemon and the second one starts
  it.
 
  /sbin/service $SOME_initscript_located_in_/etc/init.d/ and
  /etc/init.d/$SOME_initscript are essentially the same
 
  Craig
 
 

 Hi Craig
  we can stop NetworkManager from typing '/sbin/service NetworkManager 
 stop' Why we can also stop NetworkManger from /etc/init.d/NetworkManager 
 stop? What's the difference between these two places?
 thanks
 nathan

from 'man service'

DESCRIPTION
service  runs  a System V init script in as predictable environment as
possible, removing most environment variables and with current working
directory set to /.

Craig


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: What's the difference between /etc/init.d and /sbin/service

2009-04-18 Thread Lars E. Pettersson

On 04/18/2009 04:53 PM, Remi Collet wrote:

One typical issue is environment variable need to start apache defined
in root interactive session and not during boot process.
(Such variable must be add to /etc/sysconfig/apache)

So please : don't use directly /etc/init.d/foo script


Exactly what is the problem with the apache /etc/init.d/-script?

I more or less never uses /sbin/services, I always use the 
/etc/init.d/-scripts directly. And regarding apache I have not seen any 
side effects, but perhaps I have missed something?


/Lars
--
Lars E. Pettersson l...@homer.se
http://www.sm6rpz.se/

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: What's the difference between /etc/init.d and /sbin/service

2009-04-18 Thread Kevin Kofler
Nathan Huang wrote:
 [miran...@charon ~]$ su -c '/etc/init.d/NetworkManager stop'

That's the braindead Debian way and should not be used in Fedora, that's
what the service command is for.

It's available even for Debian:
http://packages.debian.org/sid/chkconfig

Ubuntu these days ships a /usr/bin/service (why in /usr/bin??) as part of
the following essential package:
http://packages.ubuntu.com/jaunty/sysvinit-utils

Fedora has been using service since basically forever (it was already
there in Red Hat Linux). And you should not have to specify /sbin as it
has been added to the PATH for all users in F10.

Kevin Kofler

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: What's the difference between /etc/init.d and /sbin/service

2009-04-18 Thread Remi Collet
Le 18/04/2009 18:59, Lars E. Pettersson a écrit :

 Exactly what is the problem with the apache /etc/init.d/-script?

One example (probably very specific, but I have to fight with it,
in my first experience of sysadmin...)

You use want to use apache with php and Oracle.

In your root environment you have all the stuff needed
(mainly LD_LIBRARY_PATH, yes I know it's stupid, but it's Oracle)

If you use /etc/init.d/httpd script apache will start.

On next reboot it wouldn't because of missing environment ;)

+

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: What's the difference between /etc/init.d and /sbin/service

2009-04-18 Thread Sam Varshavchik

Nathan Huang writes:


Hi guys
I face a problem, What 's the difference between these two commands?

[miran...@charon ~]$ su -c '/etc/init.d/NetworkManager stop'

[miran...@charon ~]$ |su -c '/sbin/service NetworkManager start 


The service command sets up a few things in the environment. In addition, on 
systems that use SELinux, it sets up the right SELinux context.





pgpugpb8maG9F.pgp
Description: PGP signature
-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines