OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] Better detection of used distribution in OpenVZ initscript.
[PATCH] Better detection of used distribution in OpenVZ initscript. [message #2153] Wed, 22 March 2006 22:13
Maik Broemme is currently offline  Maik Broemme
Messages: 2
Registered: February 2006
Junior Member
Hi,

attached is a diff which fixes the distribution detection on my LFS
(Linuxfromscratch) system, also i guess it is more accurate now. :)

Original version:

root@bart:/etc/rc.d/init.d# /etc/rc.d/init.d/vz start
Starting OpenVZ: /etc/rc.d/init.d/vz: line 94: echo_success: command not found
Bringing up interface venet0: /etc/rc.d/init.d/vz: line 94: echo_success: command not found
Configuring interface venet0: net.ipv4.conf.venet0.send_redirects = 0
/etc/rc.d/init.d/vz: line 94: echo_success: command not found
root@bart:/etc/rc.d/init.d#

Modified version:

root@bart:/etc/rc.d/init.d# /etc/rc.d/init.d/vz start
Starting OpenVZ:
Bringing up interface venet0:
Configuring interface venet0: net.ipv4.conf.venet0.send_redirects = 0

root@bart:/etc/rc.d/init.d#

I guess the DISTR variable should only be set if we are really working
under that distribution. For example: On my LFS system i have
`/etc/init.d/functions' but not `/etc/redhat-release' but this file every
RedHat based distribution includes.

--Maik

--- vz.orig 2006-03-22 22:56:22.553944500 +0100
+++ vz 2006-03-22 23:11:31.474748500 +0100
@@ -52,11 +52,15 @@

# Source function library.
if [ -r /etc/init.d/functions ]; then
- DISTR=redhat
source /etc/init.d/functions
+ if [ -r /etc/redhat-release ] || [ -r /etc/centos-release ]; then
+ DISTR=redhat
+ fi
elif [ -r /etc/rc.status ]; then
- DISTR=suse
source /etc/rc.status
+ if [ -r /etc/SuSE-release ]; then
+ DISTR=suse
+ fi
else
rc_done='^[[71G done'
rc_failed='^[[71Gfailed'
  • Attachment: vz.patch
    (Size: 0.49KB, Downloaded 480 times)
 
Read Message
Previous Topic: [PATCH] futher {ip,ip6,arp}_tables unification
Next Topic: GIT repository for OpenVZ opened
Goto Forum:
  


Current Time: Sat Sep 14 14:26:31 GMT 2024

Total time taken to generate the page: 0.03994 seconds