# yum install iscsi-initiator-utilsCheck out the initiator file to get the IQN:
# cat /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.1988-12.com.oracle:acbd8bf16757
# yum install iscsi-initiator-utilsCheck out the initiator file to get the IQN:
# cat /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.1988-12.com.oracle:acbd8bf16757
root@icinga2-p0 etc # semanage fcontext -a -t httpd_sys_rw_content_t "/etc/icingaweb2(/.*)?" root@icinga2 etc # restorecon -Rv /etc/icingaweb2 restorecon reset /etc/icingaweb2 context system_u:object_r:etc_t:s0->system_u:object_r:httpd_sys_rw_content_t:s0 restorecon reset /etc/icingaweb2/setup.token context unconfined_u:object_r:etc_t:s0->unconfined_u:object_r:httpd_sys_rw_content_t:s0 restorecon reset /etc/icingaweb2/modules context system_u:object_r:etc_t:s0->system_u:object_r:httpd_sys_rw_content_t:s0 restorecon reset /etc/icingaweb2/modules/translation context system_u:object_r:etc_t:s0->system_u:object_r:httpd_sys_rw_content_t:s0 restorecon reset /etc/icingaweb2/modules/translation/config.ini context system_u:object_r:etc_t:s0->system_u:object_r:httpd_sys_rw_content_t:s0 restorecon reset /etc/icingaweb2/modules/setup context system_u:object_r:etc_t:s0->system_u:object_r:httpd_sys_rw_content_t:s0 restorecon reset /etc/icingaweb2/modules/setup/config.ini context system_u:object_r:etc_t:s0->system_u:object_r:httpd_sys_rw_content_t:s0
#!/bin/sh host=`hostname -f` date=`date` # run updates to get latest software and kernel yum -y update maxdelay=$((6*60)) rdelay=$(($RANDOM%maxdelay)) sdelay=$(($rdelay*60)) kernel=`uname -r` latest=`rpm -q kernel --queryformat '%{installtime} %{version}-%{release}.%{arch}\n' | sort -n -k1 | tail -1 | cut -d ' ' -f 2` sdate=`date` if [ "$kernel" = "$latest" ]; then echo "No need to reboot..." echo "You are running the latest kernel: $kernel" else echo "There is a new kernel. You need a reboot..." echo "Current kernel: $kernel" echo "The latest kernel: $latest" echo "$sdate\nCurrent kernel: $kernel\nLatest kernel: $latest" echo "Sleeping for $sdelay seconds..." sleep $sdelay echo "Waking up and rebooting..." /sbin/reboot fi
mount /dev/sdXY /mnt mount --bind /dev /mnt/dev && mount --bind /dev/pts /mnt/dev/pts && mount --bind /proc /mnt/proc && mount --bind /sys /mnt/sys chroot /mnt grub-install /dev/sdX grub-install --recheck /dev/sdX
update-rc.d <service> defaults update-rc.d <service> start 20 3 4 5 update-rc.d -f <service> removePart of the man page:
UPDATE-RC.D(8) sysv-rc UPDATE-RC.D(8) NAME update-rc.d - install and remove System-V style init script links SYNOPSIS update-rc.d [-n] [-f] name remove update-rc.d [-n] name defaults [NN | SS KK] update-rc.d [-n] name start|stop NN runlevel [runlevel]... . start|stop NN runlevel [run‐ level]... . ... update-rc.d [-n] name disable|enable [ S|2|3|4|5 ] DESCRIPTION update-rc.d updates the System V style init script links /etc/rcrunlevel.d/NNname whose target is the script /etc/init.d/name. These links are run by init when it changes runlevels; they are gen‐ erally used to start and stop system services such as daemons. runlevel is one of the runlevels supported by init, namely, 0123456789S, and NN is the two-digit sequence number that determines where in the sequence init will run the scripts. This manpage documents only the usage and behaviour of update-rc.d. For a discussion of the Sys‐ tem V style init script arrangements please see init(8) and the Debian Policy Manual.
-bash-3.2# cat /etc/redhat-release CentOS release 5.11 (Final) -bash-3.2# yum update Loaded plugins: downloadonly, fastestmirror Determining fastest mirrors YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Invalid release/ removing mirrorlist with no valid mirrors: /var/cache/yum/base/mirrorlist.txt Error: Cannot find a valid baseurl for repo: baseAll repo contents have been moved to http://vault.centos.org so to fix the problem, the other repos must be removed:
-bash-3.2# ls /etc/yum.repos.d/CentOS- CentOS-Base.repo CentOS-Media.repo CentOS-Vault.repo CentOS-Debuginfo.repo CentOS-Sources.repo CentOS-fasttrack.repo -bash-3.2# ls /etc/yum.repos.d/CentOS-Leaving only CentOS-Vault.repo:
-bash-3.2# yum update Loaded plugins: downloadonly, fastestmirror Determining fastest mirrors Setting up Update Process No Packages marked for Update -bash-3.2#
init=/bin/shBoot this and the Linux OS will boot to a shell. Mount / as rewrite:
mount -o remount,rw /Change the root password:
passwdReboot Linux OS:
reboot