Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
On Thu, Feb 20, 2003 at 12:39:51PM -0500, Phil Barnett wrote: Gentoo does not care for the whole linux community larry the cow was frustrated with the state of the current distributions (very possibly RH since as you noted it's majority) he found the functionality he wanted instead of the functionailty THEY WANTED YOU TO HAVE. This is not bad functionality. It's simplicity. Simplicity is good no matter where it comes from. As others have asked, how is service foo start simpler than /etc/init.d/foo start ? Fewer characters to type? So that's point one; I, and others, don't understand what one really gains by adding the RedHat stuff (which I think actually traces its lineage to IRIX, and boy am I glad I didn't grow to depend on their extensions to Unix given where they're headed now, but I digress). But a lot of people cut their teeth on RedHat, so people like me can scream all we want about how important it is to learn the general case (init.d/foo start|stop), there will still be people who show up not knowing anything other than service start|stop -- and chkconfig instead of the more abstract runlevels with links to general-purpose scripts. Fine. There's a problem here: we (well, somebody) would like Gentoo to have the capacity to emulate the RedHat/IRIX way of doing things. Well, in the time this little pissing contest has been going on, I've learned a fair amount about how the Debian packaging system works. I'm already passing literate (if far from fluent) in the nuts and bolts of the ebuild system. In a few more hours I expect to be able to start distributing Debian packages ('cuz that's what we run here at work) to my own couple hundred machines so that my users can have the things they expect which aren't in Debian, without us having to trot around to all our boxen individually. All of which is just a roundabout way of saying that if you want something, and you can't convince anybody else to do it, there's really nothing stopping you from doing it yourself. These packaging systems are not all that hard to learn -- not trivial maybe, but I'm no Einstein and I'm doing it. Maybe your rh-compat package won't make it into the main Gentoo archive (or maybe it will), but it'll be in your own, and maybe others will link to you and then they'll have it. And who knows, if you write a good enough initialization compatibility package, one that really /does/ add a layer of abstraction rather than just a shorter euphamism for the existing SysV stuff, you might actually have something that /could/ be ported to a BSD-style system as well as the various diverging traditions of SysV. So yeah, Gentoo reinvented the wheel. I like their new wheel; but if for some reason I had to run OpenBSD and FreeBSD and IRIX and RedHat and Gentoo /and/ I had to run them all to do more or less the same set of stuff (dear lord), I could install the MetaInit package on all of them and from now on I no longer have to know where I'm sitting before I start apache, I just run service apache start and I'm off to the next task. Well, unless the machine I'm on calls apache httpd or webserver in which case... oh never mind. -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
lots of nasty arguments... start here #!/bin/bash /etc/init.d/$1 $2 end here make a new file called /usr/sbin/service and put these 2 lines in it. et voila. you got your Redhat service script now. -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
I wrote a very quick dirty script cat /sbin/service #!/bin/sh /etc/init.d/$1 $2 now I can service samba stop|start etc the problem is remebering service names (is it samba? or smb? or smbd? - redhat calls it smb, gentoo calls it samba) On Tue, 18 Feb 2003 08:48:17 -0500 Phil Barnett [EMAIL PROTECTED] wrote: On Tuesday 18 February 2003 8:39 am, brett holcomb wrote: What are you trying to do?? Any distro will tell you a service is started if it's already running. You do a /etc/init.d/service restart if you want to restart it. This is equivalent of a stop then a start. Gentoo's init service is the same as all the others - the directories may be different but they all do /etc/somedir/servicename start/stop/restart/... . What I miss in Gentoo is the simple format for services like found in Redhat and many others, ie: service servicename stop/start/restart It eliminates needing to know where the service directory is or including it every time. service httpd stop is a lot easier than any other incarnation and make any system easier to admin. -- [EMAIL PROTECTED] mailing list -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user]service parameter passing?]
-- Nick Rout [EMAIL PROTECTED] spake thusly: I wrote a very quick dirty script cat /sbin/service # !/bin/sh /etc/init.d/$1 $2 now I can service samba stop|start etc the problem is remebering service names (is it samba? or smb? or smbd? - redhat calls it smb, gentoo calls it samba) If you emerge bash-completion, it's already got tab-completion for the service command. service aptab gives me service apache2. -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user]service parameter passing?]
On Tue, 18 Feb 2003 09:28:18 -0500, Phil Barnett wrote: On Tuesday 18 February 2003 8:56 am, Alexander Futasz wrote: shellscript #!/bin/sh /etc/init.d/$1 $2 /shellscript put that in /usr/sbin or whereever you like, name it service, give it the right permissions and you will have the functionality you described. i read that before on the list, so it must be somewhere on the archives too. 1. It should be part of Gentoo, not some hack that I put together. if you want to have it officially in gentoo you'd have to file a bugreport. bugzilla.gentoo.org -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
On Wednesday 19 February 2003 8:02 am, Andrew Dacey wrote: - Original Message - From: Phil Barnett [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 19, 2003 1:31 AM Subject: Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?] Anything that makes it easier to transition from the other Linux flavors where the init files are laid out very differently would make those testing the waters feel much more welcome. If that's not anyone's goal here, then I'm tilting at windmills. I'm not sure what you mean here. Yes, there are some differences with the layout of the runlevel directories but Gentoo uses the same basic structure as RH and Mandrake do. Well, I guess that's where you and I differ. I don't think they work at all the same. I see Gentoo's run levels as more like BSD than RH. Really, the service script is only about one thing. Abstraction. If I have a room full of several differing servers and I'm and admin, the last thing I want to have to remember in the heat of the moment is how to do something on _this_ machine. Stopping and starting services is one of the admins primary job. All the service script does is abstract the stopping and starting of servers so you no longer need to know which directory to look in to find the scripts. Perhaps you have never dealt with a room full of a hundred different servers, but anything we can do to help that guy out will be appreciated. Other than abstraction of where the service files lie, the service script is of no use whatsoever. -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
I heard Phil Barnett said: If I have a room full of several differing servers and I'm and admin, the last thing I want to have to remember in the heat of the moment is how to do something on _this_ machine. Hmm, then I'd say it's pretty much -your- responsibility, not Gentoo's, to add this abstraction layer the way -you- want it. I mean, you want your room full of servers working the RH way, and that's fine, but other people may very well prefer their abstraction to work the Debian or the BSD way, and there is no compelling reason for Gentoo to favor a system over any other. (If anything, the Gentoo way is IMO more modern and more powerful, so I'd rather port it to other distros than the other way around!) Besides, it's not like writing this abstraction layer was anywhere near difficult, as the many fine scripts already posted here show. :) Good luck with Gentoo, Phil, I hope you'll enjoy it! -- S. -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
On Wednesday 19 February 2003 1:11 pm, Sundance wrote: I heard Phil Barnett said: If I have a room full of several differing servers and I'm and admin, the last thing I want to have to remember in the heat of the moment is how to do something on _this_ machine. Hmm, then I'd say it's pretty much -your- responsibility, not Gentoo's, to add this abstraction layer the way -you- want it. Perhaps this is true, but if you can admit that you are more likely to have a room full of RH servers than a room full of Gentoo or any other distro servers, you are on the way to my point. And, this mythical room full of servers is statistically proven. RH has more servers out there. I mean, you want your room full of servers working the RH way, and that's fine, but other people may very well prefer their abstraction to work the Debian or the BSD way, and there is no compelling reason for Gentoo to favor a system over any other. (If anything, the Gentoo way is IMO more modern and more powerful, so I'd rather port it to other distros than the other way around!) I don't have any problems with that, but everyone here is biased. The fact is that there are more RH servers out there than any other single distro. With that said, I do see that RH has symlinked /etc/init.d to /etc/rc.d/init.d. Didn't know that was there. Learned RH long before that. Besides, it's not like writing this abstraction layer was anywhere near difficult, as the many fine scripts already posted here show. :) Exactly, and it's not just in RH by the way. At any rate, that service script is already on more servers that you give credit for. Good luck with Gentoo, Phil, I hope you'll enjoy it! Well, it's been my desktop for about 6 months and I'm doing just fine with it. I just miss the service abstraction that I've become used to from several other distros. And, yes, I can put it there. But, being such a small script and being as widely used as it is, I don't see any reason for it to not be in there. There are literally dozens of other abstractions that we all take for granted in nearly every distro. This is just another one. I'll not tilt at windmills. It's not for me to say which abstractions you never notice and which you do. I'm sure you will agree that you take advantage of dozens of abstractions just like that one every day... -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
On Wednesday 19 February 2003 11:01 pm, Andrew Dacey wrote: I'm not saying that you shouldn't be able to do it the way you're used to. I'm just saying that it shouldn't effect the way I work. The whole point is to have choice. Did you read that before you sent it? It makes my point perfectly. Nothing about the script in question would effect the way you work, it would just give choice. I'm glad you agree with me. -- [EMAIL PROTECTED] mailing list
[gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
yet another annoing feature is that if I want to run start() separately for different interfaces I can't 'cause it tell's me that : WARNING blah has been already started. i thought gentoo init process is superior to other distros but my current expiriences are always troublesome... I give up on the ability to bring up hdlc and pvc devices separately 'cause depencity system works only on service base so it was usless in my case... Now the same with my try to do per interface control for Traffic Control via init procedure... The only thing that seems suitable to my case is the einfo formating... hmmm... better do in normal way... raptor PS. net.interface way is also not suitable to my case... 'cause I want to do this as service not as per interface scripts, and it is too redunant.. -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
On Tuesday 18 February 2003 8:39 am, brett holcomb wrote: What are you trying to do?? Any distro will tell you a service is started if it's already running. You do a /etc/init.d/service restart if you want to restart it. This is equivalent of a stop then a start. Gentoo's init service is the same as all the others - the directories may be different but they all do /etc/somedir/servicename start/stop/restart/... . What I miss in Gentoo is the simple format for services like found in Redhat and many others, ie: service servicename stop/start/restart It eliminates needing to know where the service directory is or including it every time. service httpd stop is a lot easier than any other incarnation and make any system easier to admin. -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user]service parameter passing?]
On Tue, 18 Feb 2003 08:48:17 -0500, Phil Barnett wrote: What I miss in Gentoo is the simple format for services like found in Redhat and many others, ie: service servicename stop/start/restart It eliminates needing to know where the service directory is or including it every time. service httpd stop is a lot easier than any other incarnation and make any system easier to admin. shellscript #!/bin/sh /etc/init.d/$1 $2 /shellscript put that in /usr/sbin or whereever you like, name it service, give it the right permissions and you will have the functionality you described. i read that before on the list, so it must be somewhere on the archives too. -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
On Tue, 18 Feb 2003 08:48:17 -0500 Phil Barnett [EMAIL PROTECTED] wrote: On Tuesday 18 February 2003 8:39 am, brett holcomb wrote: What are you trying to do?? Any distro will tell you a service is started if it's already running. You do a /etc/init.d/service restart if you want to restart it. This is equivalent of a stop then a start. Gentoo's init service is the same as all the others - the directories may be different but they all do /etc/somedir/servicename start/stop/restart/... . What I miss in Gentoo is the simple format for services like found in Redhat and many others, ie: service servicename stop/start/restart vi /usr/bin/service #!/bin/sh /etc/init.d/$1 $2 EOF chmod gu+x /usr/bin/service Henti Smith -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user]service parameter passing?]
On Tue, 2003-02-18 at 13:48, Phil Barnett wrote: What I miss in Gentoo is the simple format for services like found in Redhat and many others, ie: service servicename stop/start/restart It eliminates needing to know where the service directory is or including it every time. service httpd stop is a lot easier than any other incarnation and make any system easier to admin. legolas files # cat /usr/bin/service #!/bin/bash if test -x /etc/init.d/$1 then /etc/init.d/$1 $2 else echo Service not found. fi -- Mike Williams [EMAIL PROTECTED] signature.asc Description: This is a digitally signed message part
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user]service parameter passing?]
I see now. I guess I grew up with the /etc/... method and got used to it and used it even on RH - RH was the first I've seen the shortcut on. Several others have posted some scripts you could use. On Tue, 18 Feb 2003 08:48:17 -0500 Phil Barnett [EMAIL PROTECTED] wrote: On Tuesday 18 February 2003 8:39 am, brett holcomb wrote: What are you trying to do?? Any distro will tell you a service is started if it's already running. You do a /etc/init.d/service restart if you want to restart it. This is equivalent of a stop then a start. Gentoo's init service is the same as all the others - the directories may be different but they all do /etc/somedir/servicename start/stop/restart/... . What I miss in Gentoo is the simple format for services like found in Redhat and many others, ie: service servicename stop/start/restart It eliminates needing to know where the service directory is or including it every time. service httpd stop is a lot easier than any other incarnation and make any system easier to admin. -- [EMAIL PROTECTED] mailing list -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
On Tuesday 18 February 2003 8:56 am, Alexander Futasz wrote: On Tue, 18 Feb 2003 08:48:17 -0500, Phil Barnett wrote: What I miss in Gentoo is the simple format for services like found in Redhat and many others, ie: service servicename stop/start/restart It eliminates needing to know where the service directory is or including it every time. service httpd stop is a lot easier than any other incarnation and make any system easier to admin. shellscript #!/bin/sh /etc/init.d/$1 $2 /shellscript put that in /usr/sbin or whereever you like, name it service, give it the right permissions and you will have the functionality you described. i read that before on the list, so it must be somewhere on the archives too. Well, there's two points to make here. 1. It should be part of Gentoo, not some hack that I put together. 2. The RH service script does a whole lot more than that, take a look, it's gpl... [root@gizmo root]# cat /sbin/service #!/bin/sh # Set up a default search path. PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin export PATH VERSION=`basename $0` ver. 0.91 USAGE=Usage: `basename $0` option | --status-all | \ [ service_name [ command | --full-restart ] ] SERVICE= SERVICEDIR=/etc/init.d if [ $# -eq 0 ]; then echo $${USAGE} 2 exit 1 fi cd / while [ $# -gt 0 ]; do case ${1} in --help | -h | --h* ) echo $${USAGE} 2 exit 0 ;; --version | -V ) echo $${VERSION} 2 exit 0 ;; *) if [ -z ${SERVICE} -a $# -eq 1 -a ${1} = --status-all ]; then cd ${SERVICEDIR} for SERVICE in * ; do case ${SERVICE} in functions | halt | killall | single| linuxconf| kudzu | \ *rpmorig | *rpmnew | *rpmsave | *~ | *.orig) ;; *) if [ -x ${SERVICEDIR}/${SERVICE} ]; then env -i LANG=$LANG PATH=$PATH ${SERVICEDIR}/${SERVICE} status fi ;; esac done exit 0 elif [ $# -eq 2 -a ${2} = --full-restart ]; then SERVICE=${1} if [ -x ${SERVICEDIR}/${SERVICE} ]; then env -i LANG=$LANG PATH=$PATH ${SERVICEDIR}/${SERVICE} stop env -i LANG=$LANG PATH=$PATH ${SERVICEDIR}/${SERVICE} start exit $? fi elif [ -z ${SERVICE} ]; then SERVICE=${1} else OPTIONS=${OPTIONS} ${1} fi shift ;; esac done if [ -x ${SERVICEDIR}/${SERVICE} ]; then env -i LANG=$LANG PATH=$PATH ${SERVICEDIR}/${SERVICE} ${OPTIONS} else echo $${SERVICE}: unrecognized service 2 exit 1 fi -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
On Tue, 18 Feb 2003 09:28:18 -0500 Phil Barnett [EMAIL PROTECTED] wrote: Well, there's two points to make here. 1. It should be part of Gentoo, not some hack that I put together. This is up to the developers to decide. it might be a good idea, but in the end their decision. 2. The RH service script does a whole lot more than that, take a look, it's gpl... gpl does not mean everybody must use it, only that if so desired it can be used. Personally I have never used redhat so the service command is a non event in my life. there are alot of things not included in gentoo that I have to add manually afterwards. from an admin point of view ... I know everything is in /etc/init.d/ so service would not help my anyway since my fingers are used to typing /etc/init.d (with tab completion of course) Just my 5 cents worth .. at current exchange rate .. thats about 0.01 cent US If you REALLY want the service included ... write an ebuild for it and submit it. emerge rh-service and you can have it part of gentoo while other cannot care less that it's not included. Henti -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Gentoo init system : was [Re: [gentoo-user] service parameter passing?]
On Tuesday 18 February 2003 9:52 am, Henti Smith wrote: On Tue, 18 Feb 2003 09:28:18 -0500 Phil Barnett [EMAIL PROTECTED] wrote: Well, there's two points to make here. 1. It should be part of Gentoo, not some hack that I put together. This is up to the developers to decide. it might be a good idea, but in the end their decision. Anything that makes it easier to transition from the other Linux flavors where the init files are laid out very differently would make those testing the waters feel much more welcome. If that's not anyone's goal here, then I'm tilting at windmills. 2. The RH service script does a whole lot more than that, take a look, it's gpl... gpl does not mean everybody must use it, only that if so desired it can be used. Wow, really! You mean I don't have to download every project on SourceForge? My point in mentioning that it's gpl was to point out that it's ok to post it in a public forum. Personally I have never used redhat so the service command is a non event in my life. there are alot of things not included in gentoo that I have to add manually afterwards. from an admin point of view ... I know everything is in /etc/init.d/ so service would not help my anyway since my fingers are used to typing /etc/init.d (with tab completion of course) Just my 5 cents worth .. at current exchange rate .. thats about 0.01 cent US If you REALLY want the service included ... write an ebuild for it and submit it. emerge rh-service and you can have it part of gentoo while other cannot care less that it's not included. You know, if I just had about 10 more hours each day do to do things like this, my life would be complete. What I was hoping for was that someone who does have the time and talent would pick it up and play with it and I would benefit by making others aware of this shortcut. -- [EMAIL PROTECTED] mailing list