# # # osds_acfsload.pm # # Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. # # # NAME # osds_acfsload.pm - Linux OSD component of acfsload. # # DESCRIPTION # Purpose # start / stop previously installed USM drivers. # # NOTES # All user visible output should be done in the common code. # this will ensure a consistent look and feel across all platforms. # # use strict; package osds_acfsload; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw( osds_check_asmadmin_changed osds_verify_correct_driver_version ); use osds_acfslib; use acfslib; use File::Basename; # osds_check_asmadmin_changed # We're called after the drivers are confirmed as installed. # look at the current udev permissions and see if the name of the # ASM admin group has changed. If so, we re-create the USM udev files # with the correct ASM admin name. sub osds_check_asmadmin_changed { my ($RH5); my ($udev_asmadmin); my ($asmadmin); my ($udev_perm_file); my ($ORACLE_HOME) = $ENV{ORACLE_HOME}; # get the current system ASM admin group name $asmadmin = lib_get_asm_admin_name(); # now get the ASM admin name recorded un the USM rules file $udev_perm_file = lib_osds_get_usm_udev_rules_file(); # get the current udev ASM admin group name my($ret) = open (UDEV, "< $udev_perm_file"); if (defined($ret)) { while () { # file format example: # KERNEL=="ofsctl" GROUP="dba" MODE="0664" my ($name, $group, $mode) = split /,/; if ($name eq "KERNEL==\"ofsctl\"") { my (@tmp_array) = split(/=/, $group); $udev_asmadmin = $tmp_array[1]; $udev_asmadmin =~ s/\"//g; last; } } close (UDEV); } # if the ASM admin name has not changed (typical case), we're done if (!defined($udev_asmadmin)) { # this should not happen but..... $udev_asmadmin = "no udev file found"; } if ($asmadmin eq $udev_asmadmin) { return USM_SUCCESS; } lib_osds_create_udev($asmadmin); return USM_SUCCESS; } # end osds_check_asmadmin_changed # osds_verify_correct_driver_version # # No longer needed. This code was only useful for RH4 where the driver version # had to match the running kernel version. # sub osds_verify_correct_driver_version { return 1; } # end osds_verify_correct_driver_version