├── .gitignore ├── AUTHORS ├── CHECKSUM.MD5 ├── CHECKSUM.SHA256 ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.in ├── README ├── THANKS ├── TODO ├── configure.ac ├── contrib ├── 50-rbd.rules ├── ceph-rbdnamer ├── check_zpools.sh └── list-pcie-ports.sh ├── esos2iso.sh ├── etc ├── bashrc ├── blkid.conf ├── bttab ├── ceph │ ├── ceph.conf │ └── rbdmap ├── corosync │ └── corosync.conf ├── crontab ├── fcoe │ ├── cfg-ethx │ └── config ├── fstab ├── group ├── hba.conf ├── hosts ├── infiniband │ └── openib.conf ├── inittab ├── issue ├── ld.so.conf ├── lessfs.cfg ├── lvm │ ├── lvm.conf │ └── lvmlocal.conf ├── mdadm.conf ├── mdadm.conf.d │ └── no_bbl.conf ├── mhvtl │ └── mhvtl.conf ├── minirc.dfl ├── modprobe.conf ├── network.conf ├── nrpe.cfg ├── nsswitch.conf ├── opensm │ └── partitions.conf ├── pam.d │ ├── login │ ├── other │ ├── su │ ├── su-l │ ├── sudo │ ├── system-account │ ├── system-auth │ ├── system-password │ └── system-session ├── passwd ├── profile ├── protocols ├── rc.conf ├── rc.d │ ├── common │ ├── rc.0 │ ├── rc.1 │ ├── rc.2 │ ├── rc.acpid │ ├── rc.btier │ ├── rc.corosync │ ├── rc.dlm │ ├── rc.dmcache │ ├── rc.drbd │ ├── rc.eio │ ├── rc.fsmount │ ├── rc.haveged │ ├── rc.iscsid │ ├── rc.kdump │ ├── rc.libvirtd │ ├── rc.libvirtdexporter │ ├── rc.lldpad │ ├── rc.lvm2 │ ├── rc.lvmlockd │ ├── rc.mdraid │ ├── rc.memcached │ ├── rc.mhvtl │ ├── rc.msmtpd │ ├── rc.multipathd │ ├── rc.munin │ ├── rc.network │ ├── rc.nfsd │ ├── rc.nginx │ ├── rc.nodeexporter │ ├── rc.nrpe │ ├── rc.nut │ ├── rc.nvmet │ ├── rc.openibd │ ├── rc.opensm │ ├── rc.pacemaker │ ├── rc.prometheus │ ├── rc.rasdaemon │ ├── rc.rbdmap │ ├── rc.sbd │ ├── rc.scst │ ├── rc.serial │ ├── rc.smartd │ ├── rc.snmpd │ ├── rc.snmptrapd │ ├── rc.sshd │ ├── rc.stunnel │ ├── rc.sysinit │ ├── rc.syslogd │ ├── rc.telegraf │ ├── rc.udev │ ├── rc.virtlogd │ ├── rc.vmtoolsd │ ├── rc.watchdog │ └── rc.zfs ├── rc.local ├── send_nsca.cfg ├── services ├── shadow ├── smartd.conf ├── snmp │ └── snmpd.conf ├── ssmtp │ ├── revaliases │ └── ssmtp.conf ├── sysconfig │ └── sbd ├── sysctl.conf ├── syslog.conf ├── telegraf │ └── telegraf.conf ├── ups.conf ├── upsd.conf ├── upsd.users ├── upsmon.conf └── upssched.conf ├── gitlog-to-changelog ├── install.sh ├── install.vbs ├── isolinux ├── boot.cat ├── isolinux.bin ├── isolinux.cfg └── menu.c32 ├── make_changelog.sh ├── misc ├── EnhanceIO-master_20151029.patch ├── bcache-tools-1.0.8.patch ├── btier-1.3.11.patch ├── busybox-1.30.1.config ├── cdk-5.0-20161210.patch ├── cdk-5.0-20190303.patch ├── dlm-4.0.8.patch ├── docbook-xsl-nons-1.79.2.patch ├── drbd_xsltproc │ ├── drbd-xmlproc │ └── xml2conf.xsl ├── glibc-2.29.patch ├── glibc.SUPPORTED.locales ├── grub-2.02.patch ├── grub.cfg ├── ibutils-1.5.7.patch ├── initramfs_init ├── ipmitool-1.8.18.patch ├── irqbalance-1.8.0.patch ├── kbd-2.0.4.patch ├── lessfs-1.7.0.patch ├── libvirt-6.10.0.patch ├── linux-5.4.12-debug.patch ├── linux-5.4.12.config ├── linux-5.4.12.patch ├── linux-5.4.145-debug.patch ├── linux-5.4.145.config ├── linux-5.4.145.patch ├── linux-5.4.190-debug.patch ├── linux-5.4.190.config ├── linux-5.4.190.patch ├── linux-5.4.212-debug.patch ├── linux-5.4.212.config ├── linux-5.4.212.patch ├── linux-5.4.229-debug.patch ├── linux-5.4.229.config ├── linux-5.4.229.patch ├── linux-5.4.288-debug.patch ├── linux-5.4.288.config ├── linux-5.4.288.patch ├── linux-5.4.45-debug.patch ├── linux-5.4.45.config ├── linux-5.4.45.patch ├── linux-5.4.69-debug.patch ├── linux-5.4.69.config ├── linux-5.4.69.patch ├── mdadm-4.1.patch ├── mlnx-tools-5.2.0.patch ├── ncurses-6.1.patch ├── net-snmp-5.8.patch ├── nss-3.43.patch ├── ocf │ ├── brick │ │ └── btier │ ├── esos │ │ ├── alua │ │ ├── ana │ │ ├── nvmet │ │ ├── scst │ │ └── syncro │ ├── onesty │ │ ├── .common-funcs │ │ ├── scst_aluadg │ │ └── scst_qla2xtgt │ └── stmf-ha │ │ └── zfs ├── open-vm-tools-10.3.10-12406962.patch ├── openssl-1.1.1w.patch ├── post_python_pip.patch ├── qemu-5.2.0.patch ├── qla2xxx_scst.patch ├── resource-agents-4.2.0.patch ├── sbd-1.4.1.patch ├── scst-3.7.x_20230120.patch ├── scst-3.9.x_20241230.patch ├── sg3_utils-1.45.patch ├── switchtec-user-3.0.patch └── sysvinit-2.94.patch ├── pkg_update.sh ├── scripts ├── archive_logs.sh ├── backup_conf.sh ├── boot_raid1.sh ├── cluster_start.sh ├── cluster_stop.sh ├── conf_sync.sh ├── crm_mon_email.sh ├── health_chk.sh ├── hw_raid_cli.py ├── iso_installer.sh ├── pwatcher.sh ├── raid_tools.py ├── sbd_list.sh ├── sbd_unfence.sh ├── startup.sh ├── support_pkg.sh └── usb_sync.sh └── tui ├── Makefile ├── dialogs.h ├── info_labels.c ├── main.c ├── menu_alua.c ├── menu_common.c ├── menu_devices.c ├── menu_filesys.c ├── menu_hardraid.c ├── menu_hosts.c ├── menu_interface.c ├── menu_lvm.c ├── menu_softraid.c ├── menu_system.c ├── menu_targets.c ├── prototypes.h ├── strings.c ├── strings.h ├── system.h └── utility.c /.gitignore: -------------------------------------------------------------------------------- 1 | /*.img 2 | /*.img.tar.bz2 3 | /*.zip 4 | /*.iso 5 | /dist_*.txt 6 | /VERSION 7 | /autom4te.cache/ 8 | /configure 9 | /Makefile 10 | /config.log 11 | /config.status 12 | /work/ 13 | /.work* 14 | /tui/esos_tui 15 | /tui/*.o 16 | /ChangeLog-*.txt 17 | /chroot_build.sh 18 | /bootstrap_info 19 | /bootstrap-*.tar.xz 20 | /bootstrap-*.checksum 21 | /binutils.pass1 22 | /gcc.pass1 23 | /gmp 24 | /mpfr 25 | /mpc 26 | /kernel_headers 27 | /glibc 28 | /gcc.libstdc++ 29 | /binutils.pass2 30 | /gcc.pass2 31 | /tcl 32 | /expect 33 | /dejagnu 34 | /check 35 | /ncurses 36 | /bash 37 | /bison 38 | /bzip2 39 | /coreutils 40 | /diffutils 41 | /file 42 | /findutils 43 | /gawk 44 | /gettext 45 | /grep 46 | /gzip 47 | /m4 48 | /make 49 | /patch 50 | /perl 51 | /sed 52 | /tar 53 | /texinfo 54 | /util-linux 55 | /xz 56 | /pkg-config 57 | /which 58 | /autoconf 59 | /automake 60 | /libtool 61 | /flex 62 | /zlib 63 | /libffi 64 | /Python 65 | /cmake 66 | /ninja 67 | /meson 68 | /setuptools 69 | /rsync 70 | /ocaml 71 | /findlib 72 | 73 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | The work of everyone on this project is greatly appreciated. If you are not 2 | listed here but should be, please notify us! 3 | 4 | Marc A. Smith 5 | Marcin Czupryniak 6 | Kristián Feldsam 7 | Dan Swartzendruber 8 | Michael Bischof 9 | 10 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Quantum Corporation 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | The ESOS project is comprised of a Makefile that puts all of the pieces 2 | together, scripts, config files, and a text user interface (TUI) for system 3 | management and storage provisioning functions. The Makefile fetches all 4 | required distribution files, and then extracts and compiles everything. 5 | The 'image' target will build a disk image suitable for writing to a USB flash 6 | drive; you then use this ESOS USB drive as the boot disk on your storage server. 7 | 8 | 9 | Building ESOS: 10 | In order to build ESOS, you need a recent release of a modern Linux 11 | distribution that has the software development packages installed. Please 12 | visit the ESOS project home page for all of the prerequisites and detailed 13 | build instructions: http://www.esos-project.com/ 14 | 15 | If this source is coming from GitHub then you will need to generate the 16 | configure script, otherwise if this is a release, it should already be present. 17 | 18 | The following should work in most cases (adjust -jN flag to your liking): 19 | autoconf 20 | ./configure 21 | sudo make symlink 22 | make -j5 -w -Orecurse > /tmp/bootstrap.out 2>&1 23 | sudo ./chroot_build.sh -j5 -w -Orecurse > /tmp/chroot.out 2>&1 24 | sudo rm /tools 25 | sudo make image 26 | 27 | If you would like to create a distribution tarball package: 28 | make pkg_dist 29 | 30 | You can also create a bootable ESOS ISO installer: 31 | sudo ./esos2iso.sh isolinux 32 | 33 | Installing ESOS to a USB flash drive: 34 | Once you have successfully built ESOS following the directions above, or you 35 | have downloaded/extracted a binary distribution package, run the following 36 | script from the ESOS source/package root directory: 37 | ./install.sh 38 | 39 | This script will walk you through writing the ESOS disk image to a USB flash 40 | drive and adding any desired RAID controller management utilities. 41 | 42 | Installing ESOS in a VM or onto local boot media: 43 | Use the "esos2iso.sh" script as described above and burn your ESOS ISO to a CD, 44 | or connect the ISO file using your server's virtual media feature. When the ISO 45 | menu appears, choose the "ESOS ISO Installer Script" option and the ISO will 46 | boot and prompt for the installation device. 47 | 48 | 49 | Help: 50 | If you're still having trouble building/installing ESOS, even after reading the 51 | detailed documentation on the project home page, please use the Google Group 52 | for support: http://groups.google.com/group/esos-users 53 | 54 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ESOS (Enterprise Storage OS) is a Linux distribution of sorts that provides 2 | block-level storage targets. Its based on the Linux kernel and the SCST 3 | project. It also provides all of the necessary utilities/tools to configure 4 | your back-end storage devices (eg, hardware RAID controllers, Logical Volume 5 | Management, Linux software RAID, etc.). A text user interface (TUI) is also 6 | included for storage provisioning and system management tasks. 7 | 8 | ESOS has been actively developed since January 2012, and its feature set 9 | continues to grow. Many people find ESOS to be quite stable and useful. Many 10 | use ESOS in production / live environments. 11 | 12 | The project home is located here: http://www.esos-project.com/ 13 | 14 | Please visit the above URL for more documentation on ESOS, including usage, 15 | installation, etc. The included INSTALL document provides brief build/install 16 | instructions. 17 | 18 | All questions/comments/etc. should be directed to the "esos-users" Google Group, 19 | located here: http://groups.google.com/group/esos-users 20 | 21 | -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- 1 | A special thanks to the SCST (scst.sourceforge.net) project & development 2 | team -- ESOS is built around SCST, and we really owe everything to them. 3 | 4 | http://www.linuxfromscratch.org/hints/downloads/files/bsd-init.txt 5 | This article was very helpful in designing ESOS, specifically with the 6 | init setup (BSD style). 7 | 8 | http://www.sidebranch.com/papers/How%20To%20Install%20GRUB%20into%20a%20disk%20image.pdf 9 | Lots of information/ideas came from this document when creating the 'image' 10 | Makefile recipe and the disk imaging process. 11 | 12 | The Linux From Scratch (LFS) project has been very helpful with everything from 13 | specific package build recipes, to cross-compiler setup. Their work is very 14 | much appreciated! 15 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | See this URL: https://github.com/quantum/esos/wiki/06_ESOS_Development 2 | -------------------------------------------------------------------------------- /contrib/50-rbd.rules: -------------------------------------------------------------------------------- 1 | KERNEL=="rbd[0-9]*", ENV{DEVTYPE}=="disk", PROGRAM="/usr/bin/ceph-rbdnamer %k", SYMLINK+="rbd/%c{1}/%c{2}" 2 | KERNEL=="rbd[0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/usr/bin/ceph-rbdnamer %k", SYMLINK+="rbd/%c{1}/%c{2}-part%n" 3 | -------------------------------------------------------------------------------- /contrib/ceph-rbdnamer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DEV=$1 4 | NUM=`echo $DEV | sed 's#p.*##g' | tr -d 'a-z'` 5 | POOL=`cat /sys/devices/rbd/$NUM/pool` 6 | IMAGE=`cat /sys/devices/rbd/$NUM/name` 7 | SNAP=`cat /sys/devices/rbd/$NUM/current_snap` 8 | if [ "$SNAP" = "-" ]; then 9 | echo -n "$POOL $IMAGE" 10 | else 11 | echo -n "$POOL $IMAGE@$SNAP" 12 | fi 13 | -------------------------------------------------------------------------------- /etc/bashrc: -------------------------------------------------------------------------------- 1 | # Environment settings 2 | export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin" 3 | export EDITOR="/usr/bin/vim" 4 | export VISUAL="/usr/bin/vim" 5 | export MANPATH="/usr/share/man" 6 | export PAGER="/usr/bin/less -R" 7 | 8 | # Set the prompt 9 | export PS1="[\u@\h \W]\\$ " 10 | 11 | # Some useful aliases 12 | alias l.='ls -d .* --color=auto' 13 | alias ll='ls -l --color=auto' 14 | alias ls='ls --color=auto' 15 | alias mv='mv -i' 16 | alias cp='cp -i' 17 | alias rm='rm -i' 18 | 19 | # Our locale setup 20 | export LC_ALL=en_US.UTF-8 21 | export LANG=en_US.UTF-8 22 | export LANGUAGE=en_US.UTF-8 23 | 24 | # Enhancements for bash itself 25 | HISTTIMEFORMAT="%c " 26 | HISTCONTROL=ignoredups:erasedups 27 | HISTSIZE=10000 28 | HISTFILESIZE=10000 29 | shopt -s histappend 30 | 31 | -------------------------------------------------------------------------------- /etc/blkid.conf: -------------------------------------------------------------------------------- 1 | CACHE_FILE=/dev/null 2 | -------------------------------------------------------------------------------- /etc/bttab: -------------------------------------------------------------------------------- 1 | # EXAMPLE modify before copy to /etc 2 | #/data/ssd.img:/data/sata.img 3 | #/dev/sdxx:/dev/sdyy 4 | -------------------------------------------------------------------------------- /etc/ceph/rbdmap: -------------------------------------------------------------------------------- 1 | # RbdDevice Parameters 2 | #poolname/imagename id=client,keyring=/etc/ceph/ceph.client.keyring 3 | -------------------------------------------------------------------------------- /etc/corosync/corosync.conf: -------------------------------------------------------------------------------- 1 | # Please read the corosync.conf.5 manual page 2 | totem { 3 | version: 2 4 | cluster_name: esos 5 | 6 | # crypto_cipher and crypto_hash: Used for mutual node authentication. 7 | # If you choose to enable this, then do remember to create a shared 8 | # secret with "corosync-keygen". 9 | crypto_cipher: none 10 | crypto_hash: none 11 | 12 | # interface: define at least one interface to communicate 13 | # over. If you define more than one interface stanza, you must 14 | # also set rrp_mode. 15 | interface { 16 | # Rings must be consecutively numbered, starting at 0. 17 | ringnumber: 0 18 | # This is normally the *network* address of the 19 | # interface to bind to. This ensures that you can use 20 | # identical instances of this configuration file 21 | # across all your cluster nodes, without having to 22 | # modify this option. 23 | bindnetaddr: 127.0.0.0 24 | # However, if you have multiple physical network 25 | # interfaces configured for the same subnet, then the 26 | # network address alone is not sufficient to identify 27 | # the interface Corosync should bind to. In that case, 28 | # configure the *host* address of the interface 29 | # instead: 30 | # bindnetaddr: 192.168.1.1 31 | # When selecting a multicast address, consider RFC 32 | # 2365 (which, among other things, specifies that 33 | # 239.255.x.x addresses are left to the discretion of 34 | # the network administrator). Do not reuse multicast 35 | # addresses across multiple Corosync clusters sharing 36 | # the same network. 37 | mcastaddr: 239.255.1.1 38 | # Corosync uses the port you specify here for UDP 39 | # messaging, and also the immediately preceding 40 | # port. Thus if you set this to 5405, Corosync sends 41 | # messages over UDP ports 5405 and 5404. 42 | mcastport: 5405 43 | # Time-to-live for cluster communication packets. The 44 | # number of hops (routers) that this ring will allow 45 | # itself to pass. Note that multicast routing must be 46 | # specifically enabled on most network routers. 47 | ttl: 1 48 | } 49 | } 50 | 51 | logging { 52 | # Log the source file and line where messages are being 53 | # generated. When in doubt, leave off. Potentially useful for 54 | # debugging. 55 | fileline: off 56 | # Log to standard error. When in doubt, set to no. Useful when 57 | # running in the foreground (when invoking "corosync -f") 58 | to_stderr: no 59 | # Log to a log file. When set to "no", the "logfile" option 60 | # must not be set. 61 | #to_logfile: yes 62 | #logfile: /var/log/cluster/corosync.log 63 | # Log to the system log daemon. When in doubt, set to yes. 64 | to_syslog: yes 65 | syslog_facility: local2 66 | # Log debug messages (very verbose). When in doubt, leave off. 67 | debug: off 68 | # Log messages with time stamps. When in doubt, set to on 69 | # (unless you are only logging to syslog, where double 70 | # timestamps can be annoying). 71 | timestamp: off 72 | logger_subsys { 73 | subsys: QUORUM 74 | debug: off 75 | } 76 | } 77 | 78 | quorum { 79 | # Enable and configure quorum subsystem (default: off) 80 | # see also corosync.conf.5 and votequorum.5 81 | provider: corosync_votequorum 82 | expected_votes: 1 83 | } 84 | -------------------------------------------------------------------------------- /etc/crontab: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin 3 | MAILTO=root 4 | HOME=/ 5 | 6 | # Check all file systems; fsck uses the exit status to indicate a problem 7 | 0 0 * * * root fsck_out=$(/usr/sbin/fsck -A -M -T -p 2>&1); fsck_exit=${?}; if [ ${fsck_exit} -gt 0 ] && [ ${fsck_exit} -lt 8 ]; then echo ${fsck_out}; fi 8 | 9 | # Configuration sync -- we cron this for a few times per day just in case 10 | 10 0,8,16 * * * root /usr/local/sbin/conf_sync.sh 11 | 12 | # If the log directory gets too big, then archive the logs to reclaim the space 13 | 20 * * * * root if [ `du -sk /var/log | awk '{print $1}'` -ge 50000 ]; then /usr/local/sbin/archive_logs.sh; fi 14 | 15 | # System health check script 16 | 30 * * * * root /usr/local/sbin/health_chk.sh > /dev/null 17 | 18 | # Set the system time 19 | 40 * * * * root if [ -s "/etc/ntp_server" ]; then /usr/sbin/ntpd -n -q -N -p `/bin/cat /etc/ntp_server`; fi > /dev/null 2>&1 20 | 21 | -------------------------------------------------------------------------------- /etc/fcoe/cfg-ethx: -------------------------------------------------------------------------------- 1 | ## Type: yes/no 2 | ## Default: no 3 | # Enable/Disable FCoE service at the Ethernet port 4 | # Normally set to "yes" 5 | FCOE_ENABLE="yes" 6 | 7 | ## Type: yes/no 8 | ## Default: no 9 | # Indicate if DCB service is required at the Ethernet port 10 | # Normally set to "yes" 11 | DCB_REQUIRED="yes" 12 | 13 | ## Type: yes/no 14 | ## Default: no 15 | # Indicate if VLAN discovery should be handled by fcoemon 16 | # Normally set to "yes" 17 | AUTO_VLAN="yes" 18 | -------------------------------------------------------------------------------- /etc/fcoe/config: -------------------------------------------------------------------------------- 1 | ## Type: yes/no 2 | ## Default: no 3 | # Switch on/off debug messages (script & C code) 4 | DEBUG="no" 5 | 6 | ## Type: yes/no 7 | ## Default: yes 8 | # All the messages go to syslog and stderr (script & C code) 9 | USE_SYSLOG="yes" 10 | 11 | ## Type: string. Driver names separated by space 12 | ## Default: list of default drivers 13 | # All supported drivers listed here are loaded when service starts 14 | SUPPORTED_DRIVERS="fcoe bnx2fc" 15 | -------------------------------------------------------------------------------- /etc/fstab: -------------------------------------------------------------------------------- 1 | devtmpfs /dev devtmpfs nosuid,mode=0755 0 0 2 | proc /proc proc defaults 0 0 3 | sysfs /sys sysfs defaults 0 0 4 | devpts /dev/pts devpts gid=5,mode=620 0 0 5 | tmpfs /dev/shm tmpfs mode=1777 0 0 6 | tmpfs /tmp tmpfs mode=1777,nosuid,noatime 0 0 7 | LABEL=ESOS_BOOT /boot vfat sync,noauto 1 1 8 | LABEL=esos_root /mnt/root ext4 sync,noauto 1 1 9 | LABEL=esos_conf /mnt/conf ext4 sync,noauto 1 1 10 | LABEL=esos_logs /mnt/logs ext4 async,noauto 1 1 11 | LABEL=esos_data /mnt/data ext4 async,noauto 1 1 12 | -------------------------------------------------------------------------------- /etc/group: -------------------------------------------------------------------------------- 1 | root:x:0:root 2 | bin:x:1:root,bin,daemon 3 | daemon:x:2:root,bin,daemon 4 | sys:x:3:root,bin,adm 5 | adm:x:4:root,adm,daemon 6 | tty:x:5: 7 | disk:x:6:root,adm 8 | lp:x:7:lp 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10:root 12 | floppy:x:11:root 13 | mail:x:12:mail 14 | news:x:13:news 15 | uucp:x:14:uucp 16 | man:x:15:man 17 | console:x:17: 18 | audio:x:18: 19 | cdrom:x:19: 20 | dialout:x:20:root 21 | tape:x:26:root 22 | video:x:27:root 23 | cdrw:x:80: 24 | usb:x:85: 25 | users:x:100:games 26 | nofiles:x:200: 27 | smmsp:x:209:smmsp 28 | utmp:x:406: 29 | nogroup::65533:vtl 30 | nobody::65534: 31 | sshd:x:22: 32 | cron:x:16: 33 | shadow:x:42: 34 | haclient:x:101:hacluster 35 | vtl:x:102:vtl 36 | nagios:x:498:nagios 37 | nut:x:103:nutmon 38 | input:x:999: 39 | kvm:x:36:qemu 40 | qemu:x:107: 41 | -------------------------------------------------------------------------------- /etc/hba.conf: -------------------------------------------------------------------------------- 1 | # This file contains names and references to HBA libraries 2 | # 3 | # Format: 4 | # 5 | # 6 | # 7 | # The library name should be prepended with the domain of 8 | # the manufacturer or driver author. 9 | # 10 | # 32bit/64bit implementation note: 11 | # If a 32bit implementation tries to load a 64 bit library, 12 | # the load will fail with the result that the 64 bit vendor 13 | # library is ignored. 14 | # Likewise, if a 64bit implementation tries to load a 32 bit library, 15 | # the load will fail with the result that the 32 bit vendor 16 | # library is ignored. 17 | 18 | org.open-fcoe.libhbalinux /usr/lib/libhbalinux.so.2 19 | 20 | 21 | # Set a debug level (depends on compilation switches) 22 | # 23 | # Format: 24 | # 25 | # "debuglevel" 26 | # 27 | # 0 is default, 1 show vendor library opens, 28 | # 2 shows function calls, 3 shows callback events 29 | # 30 | # Uncomment the next line to specify a level 31 | #debuglevel 3 32 | -------------------------------------------------------------------------------- /etc/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost 2 | ::1 localhost 3 | -------------------------------------------------------------------------------- /etc/infiniband/openib.conf: -------------------------------------------------------------------------------- 1 | # Load RDMA_UCM module 2 | RDMA_UCM_LOAD=yes 3 | 4 | # Load MTHCA 5 | MTHCA_LOAD=yes 6 | 7 | # Load QIB 8 | QIB_LOAD=yes 9 | 10 | # Load MLX4 modules 11 | MLX4_LOAD=yes 12 | 13 | # Load MLX5 modules 14 | MLX5_LOAD=yes 15 | 16 | # Load CXGB3 modules 17 | CXGB3_LOAD=yes 18 | 19 | # Load CXGB4 modules 20 | CXGB4_LOAD=yes 21 | 22 | # Load I40IW modules 23 | I40IW_LOAD=no 24 | 25 | # Load OCRDMA modules 26 | OCRDMA_LOAD=no 27 | 28 | # Load IPoIB 29 | IPOIB_LOAD=no 30 | 31 | # Enable IPoIB Connected Mode 32 | SET_IPOIB_CM=yes 33 | 34 | # Load SRP module 35 | SRP_LOAD=yes 36 | 37 | # Load ISER module 38 | ISER_LOAD=no 39 | -------------------------------------------------------------------------------- /etc/inittab: -------------------------------------------------------------------------------- 1 | id:2:initdefault: 2 | 3 | si:S:sysinit:/etc/rc.d/rc.sysinit 4 | 5 | l0:0:wait:/etc/rc.d/rc.0 6 | l1:1:wait:/etc/rc.d/rc.1 7 | l2:2:wait:/etc/rc.d/rc.2 8 | l3:3:wait:/etc/rc.d/rc.3 9 | l4:4:wait:/etc/rc.d/rc.4 10 | l5:5:wait:/etc/rc.d/rc.5 11 | l6:6:wait:/etc/rc.d/rc.6 12 | 13 | ca:12345:ctrlaltdel:/bin/echo "CTRL-ALT-DEL is disabled!" 14 | 15 | su:S1:respawn:/sbin/sulogin 16 | 17 | c1:2345:respawn:/sbin/agetty 38400 tty1 linux 18 | c2:2345:respawn:/sbin/agetty 38400 tty2 linux 19 | c3:2345:respawn:/sbin/agetty 38400 tty3 linux 20 | c4:2345:respawn:/sbin/agetty 38400 tty4 linux 21 | c5:2345:respawn:/sbin/agetty 38400 tty5 linux 22 | c6:2345:respawn:/sbin/agetty 38400 tty6 linux 23 | -------------------------------------------------------------------------------- /etc/issue: -------------------------------------------------------------------------------- 1 | 2 | =WWWWWWWWWWWWWW ,=@WWWWWWWWWWW =@#######Ww= ,=@WWWWWWWWWWW 3 | j############### 4############## @##############W 4############## 4 | j###\% #### A###W` `\%###\% #### 5 | j#############W ############Ww= #### #### ############Ww= 6 | j#############\% Y#############W #### #### Y#############W 7 | j###\% X###W \%###w @#### X###W 8 | ############### ################ \%############### ################ 9 | Y############# #############W^ `\%##########*` #############W^ 10 | 11 | Enterprise Storage OS (\s \r) \4 12 | 13 | -------------------------------------------------------------------------------- /etc/ld.so.conf: -------------------------------------------------------------------------------- 1 | /lib64 2 | /usr/lib64 3 | /usr/local/lib64 4 | /lib 5 | /usr/lib 6 | /usr/local/lib 7 | /opt/lib 8 | /usr/lib/mysql 9 | -------------------------------------------------------------------------------- /etc/lessfs.cfg: -------------------------------------------------------------------------------- 1 | # Enable informational messages about compression. 2 | DEBUG = 5 3 | HASHNAME=MHASH_TIGER192 4 | #HASHNAME=MHASH_SHA256 5 | # The (chopped) hashlen in bytes, minimum is 20. 6 | HASHLEN = 24 7 | BLOCKDATA_IO_TYPE=file_io 8 | BLOCKDATA_PATH=/mnt/fuse_data/dta/blockdata.dta 9 | #BLOCKDATA_IO_TYPE=chunk_io 10 | #BLOCKDATA_PATH=/data/dta/ 11 | # 12 | META_PATH=/mnt/fuse_data/mta 13 | META_BS=1048576 14 | # 15 | CACHESIZE=512 16 | # Flush data to disk after X seconds. 17 | COMMIT_INTERVAL=10 18 | # 19 | LISTEN_IP=127.0.0.1 20 | LISTEN_PORT=100 21 | # Not more then 2 on most machines. 22 | MAX_THREADS=16 23 | #DYNAMIC_DEFRAGMENTATION on or off, default is off. 24 | DYNAMIC_DEFRAGMENTATION=on 25 | COREDUMPSIZE=2560000000 26 | # Consider SYNC_RELAX=1 or SYNC_RELAX=2 when exporting lessfs with NFS. 27 | SYNC_RELAX=0 28 | # When BACKGROUND_DELETE=on lessfs will spawn a thread to delete 29 | # a file as a background task. This is a recently added feature 30 | # and is therefore disabled by default. 31 | BACKGROUND_DELETE=on 32 | # Requires openssl and lessfs has to be configured with --with-crypto 33 | ENCRYPT_DATA=on 34 | # ENCRYPT_META on or off, default is off 35 | # Requires ENCRYPT_DATA=on and is otherwise ignored. 36 | ENCRYPT_META=off 37 | # You don't like fsck? 38 | ENABLE_TRANSACTIONS=on 39 | # Select a blocksize to fit your needs. 40 | BLKSIZE=131072 41 | COMPRESSION=qlz 42 | #TUNEFORSPEED=yes 43 | # 44 | ##### LFS MASTER ##### 45 | #REPLICATION=masterslave 46 | #REPLICATION_ROLE=master 47 | ###BULK REPLICATION 48 | ###REPLICATION_PARTNER_IP=-1 49 | ##LFS NATIVE REPLICATION 50 | #REPLICATION_PARTNER_IP=10.10.10.10 51 | #REPLICATION_PARTNER_PORT=101 52 | #MAX_BACKLOG_SIZE=1000000 53 | ##### LFS SLAVE ##### 54 | #REPLICATION=masterslave 55 | #REPLICATION_ROLE=slave 56 | # LFS NATIVE REPLICATION 57 | #REPLICATION_LISTEN_IP=0.0.0.0 58 | # LFS BULK REPLICATION WITH WATCHDIR 59 | #REPLICATION_LISTEN_IP=-1 60 | #REPLICATION_WATCHDIR=/data/master/dta 61 | #REPLICATION_LISTEN_PORT=201 62 | #BDB_PRIVATE=on 63 | #TUNEFORSIZE=HUGE 64 | -------------------------------------------------------------------------------- /etc/lvm/lvmlocal.conf: -------------------------------------------------------------------------------- 1 | # This is a local configuration file template for the LVM2 system 2 | # which should be installed as /etc/lvm/lvmlocal.conf . 3 | # 4 | # Refer to 'man lvm.conf' for information about the file layout. 5 | # 6 | # To put this file in a different directory and override 7 | # /etc/lvm set the environment variable LVM_SYSTEM_DIR before 8 | # running the tools. 9 | # 10 | # The lvmlocal.conf file is normally expected to contain only the 11 | # "local" section which contains settings that should not be shared or 12 | # repeated among different hosts. (But if other sections are present, 13 | # they *will* get processed. Settings in this file override equivalent 14 | # ones in lvm.conf and are in turn overridden by ones in any enabled 15 | # lvm_.conf files.) 16 | # 17 | # Please take care that each setting only appears once if uncommenting 18 | # example settings in this file and never copy this file between hosts. 19 | 20 | 21 | # Configuration section local. 22 | # LVM settings that are specific to the local host. 23 | local { 24 | 25 | # Configuration option local/system_id. 26 | # Defines the local system ID for lvmlocal mode. 27 | # This is used when global/system_id_source is set to 'lvmlocal' in the 28 | # main configuration file, e.g. lvm.conf. When used, it must be set to 29 | # a unique value among all hosts sharing access to the storage, 30 | # e.g. a host name. 31 | # 32 | # Example 33 | # Set no system ID: 34 | # system_id = "" 35 | # Set the system_id to a specific name: 36 | # system_id = "host1" 37 | # 38 | # This configuration option has an automatic default value. 39 | # system_id = "" 40 | 41 | # Configuration option local/extra_system_ids. 42 | # A list of extra VG system IDs the local host can access. 43 | # VGs with the system IDs listed here (in addition to the host's own 44 | # system ID) can be fully accessed by the local host. (These are 45 | # system IDs that the host sees in VGs, not system IDs that identify 46 | # the local host, which is determined by system_id_source.) 47 | # Use this only after consulting 'man lvmsystemid' to be certain of 48 | # correct usage and possible dangers. 49 | # This configuration option does not have a default value defined. 50 | 51 | # Configuration option local/host_id. 52 | # The lvmlockd sanlock host_id. 53 | # This must be unique among all hosts, and must be between 1 and 2000. 54 | # Applicable only if LVM is compiled with lockd support 55 | # This configuration option has an automatic default value. 56 | # host_id = 0 57 | } 58 | -------------------------------------------------------------------------------- /etc/mdadm.conf: -------------------------------------------------------------------------------- 1 | # mdadm configuration file 2 | # 3 | # mdadm will function properly without the use of a configuration file, 4 | # but this file is useful for keeping track of arrays and member disks. 5 | # In general, a mdadm.conf file is created, and updated, after arrays 6 | # are created. This is the opposite behavior of /etc/raidtab which is 7 | # created prior to array construction. 8 | # 9 | # 10 | # the config file takes two types of lines: 11 | # 12 | # DEVICE lines specify a list of devices of where to look for 13 | # potential member disks 14 | # 15 | # ARRAY lines specify information about how to identify arrays so 16 | # so that they can be activated 17 | # 18 | # You can have more than one device line and use wild cards. The first 19 | # example includes SCSI the first partition of SCSI disks /dev/sdb, 20 | # /dev/sdc, /dev/sdd, /dev/sdj, /dev/sdk, and /dev/sdl. The second 21 | # line looks for array slices on IDE disks. 22 | # 23 | #DEVICE /dev/sd[bcdjkl]1 24 | #DEVICE /dev/hda1 /dev/hdb1 25 | # 26 | # If you mount devfs on /dev, then a suitable way to list all devices is: 27 | #DEVICE /dev/discs/*/* 28 | # 29 | # 30 | # The AUTO line can control which arrays get assembled by auto-assembly, 31 | # meaing either "mdadm -As" when there are no 'ARRAY' lines in this file, 32 | # or "mdadm --incremental" when the array found is not listed in this file. 33 | # By default, all arrays that are found are assembled. 34 | # If you want to ignore all DDF arrays (maybe they are managed by dmraid), 35 | # and only assemble 1.x arrays if which are marked for 'this' homehost, 36 | # but assemble all others, then use 37 | #AUTO -ddf homehost -1.x +all 38 | # 39 | # ARRAY lines specify an array to assemble and a method of identification. 40 | # Arrays can currently be identified by using a UUID, superblock minor number, 41 | # or a listing of devices. 42 | # 43 | # super-minor is usually the minor number of the metadevice 44 | # UUID is the Universally Unique Identifier for the array 45 | # Each can be obtained using 46 | # 47 | # mdadm -D 48 | # 49 | #ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371 50 | #ARRAY /dev/md1 super-minor=1 51 | #ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1 52 | # 53 | # ARRAY lines can also specify a "spare-group" for each array. mdadm --monitor 54 | # will then move a spare between arrays in a spare-group if one array has a failed 55 | # drive but no spare 56 | #ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df spare-group=group1 57 | #ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977 spare-group=group1 58 | # 59 | # When used in --follow (aka --monitor) mode, mdadm needs a 60 | # mail address and/or a program. This can be given with "mailaddr" 61 | # and "program" lines to that monitoring can be started using 62 | # mdadm --follow --scan & echo $! > /run/mdadm/mon.pid 63 | # If the lines are not found, mdadm will exit quietly 64 | MAILADDR root 65 | #PROGRAM /usr/sbin/handle-mdadm-events 66 | CREATE bbl=no 67 | -------------------------------------------------------------------------------- /etc/mdadm.conf.d/no_bbl.conf: -------------------------------------------------------------------------------- 1 | CREATE bbl=no 2 | -------------------------------------------------------------------------------- /etc/mhvtl/mhvtl.conf: -------------------------------------------------------------------------------- 1 | # Home directory for config file(s) 2 | MHVTL_CONFIG_PATH=/etc/mhvtl 3 | 4 | # Default media capacity (5 G) 5 | CAPACITY=5000 6 | 7 | # Set default verbosity [0|1] 8 | VERBOSE=0 9 | 10 | # Set kernel module debuging [0|1] 11 | VTL_DEBUG=0 12 | -------------------------------------------------------------------------------- /etc/minirc.dfl: -------------------------------------------------------------------------------- 1 | # Machine-generated file - use "minicom -s" to change parameters. 2 | pu rtscts No 3 | -------------------------------------------------------------------------------- /etc/modprobe.conf: -------------------------------------------------------------------------------- 1 | options bonding max_bonds=0 2 | options ocs_fc_scst initiator=0 loglevel=2 enable_worker_poll_no_tmo=1 fw_diag_log_size="128K" scst_sg_table_size=4096 3 | options zfs zfs_prefetch_disable=1 4 | options celerity16fc target_mode=1 5 | options qla2xxx qlini_mode="disabled" ql2xfwloadbin=2 ql2xextended_error_logging=0x1e400000 ql2xiniexchg=0 ql2xtgtexchg=16384 ql2xexchoffld=16384 ql2xmaxlogins=1024 ql2xnvmeenable=2 6 | options qla2xxx_scst qlini_mode="disabled" ql2xfwloadbin=2 ql2xextended_error_logging=0x1e400000 ql2xiniexchg=0 ql2xtgtexchg=16384 ql2xexchoffld=16384 ql2xmaxlogins=1024 ql2xnvmeenable=2 7 | options ntb_transport use_dma=1 8 | -------------------------------------------------------------------------------- /etc/network.conf: -------------------------------------------------------------------------------- 1 | # Default ESOS network configuration file 2 | 3 | [general] 4 | hostname = localhost 5 | domainname = 6 | defaultgw = 7 | nameserver1 = 8 | nameserver2 = 9 | 10 | -------------------------------------------------------------------------------- /etc/nsswitch.conf: -------------------------------------------------------------------------------- 1 | passwd: db files 2 | group: db files 3 | shadow: db files 4 | gshadow: files 5 | 6 | hosts: files dns 7 | networks: files dns 8 | 9 | protocols: db files 10 | services: db files 11 | ethers: db files 12 | rpc: db files 13 | 14 | netgroup: db files 15 | -------------------------------------------------------------------------------- /etc/opensm/partitions.conf: -------------------------------------------------------------------------------- 1 | Default=0x7fff , ipoib : ALL=full ; 2 | -------------------------------------------------------------------------------- /etc/pam.d/login: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/login 2 | 3 | auth include system-auth 4 | account include system-account 5 | password include system-password 6 | session include system-session 7 | 8 | # End /etc/pam.d/login 9 | -------------------------------------------------------------------------------- /etc/pam.d/other: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/other 2 | 3 | auth required pam_warn.so 4 | auth required pam_deny.so 5 | account required pam_warn.so 6 | account required pam_deny.so 7 | password required pam_warn.so 8 | password required pam_deny.so 9 | session required pam_warn.so 10 | session required pam_deny.so 11 | 12 | # End /etc/pam.d/other 13 | -------------------------------------------------------------------------------- /etc/pam.d/su: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/su 2 | 3 | auth required pam_env.so 4 | auth sufficient pam_rootok.so 5 | auth include system-auth 6 | account sufficient pam_succeed_if.so uid = 0 use_uid quiet 7 | account include system-account 8 | password include system-password 9 | session include system-session 10 | 11 | # End /etc/pam.d/su 12 | -------------------------------------------------------------------------------- /etc/pam.d/su-l: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/su-l 2 | 3 | auth required pam_env.so 4 | auth sufficient pam_rootok.so 5 | auth include system-auth 6 | account sufficient pam_succeed_if.so uid = 0 use_uid quiet 7 | account include system-account 8 | password include system-password 9 | session include system-session 10 | 11 | # End /etc/pam.d/su-l 12 | -------------------------------------------------------------------------------- /etc/pam.d/sudo: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/sudo 2 | 3 | auth include system-auth 4 | account include system-account 5 | password include system-password 6 | session include system-session 7 | 8 | # End /etc/pam.d/sudo 9 | -------------------------------------------------------------------------------- /etc/pam.d/system-account: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/system-account 2 | 3 | account required pam_unix.so 4 | 5 | # End /etc/pam.d/system-account 6 | -------------------------------------------------------------------------------- /etc/pam.d/system-auth: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/system-auth 2 | 3 | auth required pam_unix.so 4 | 5 | # End /etc/pam.d/system-auth 6 | -------------------------------------------------------------------------------- /etc/pam.d/system-password: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/system-password 2 | 3 | # use sha512 hash for encryption, use shadow, and try to use any previously 4 | # defined authentication token (chosen password) set by any prior module 5 | password required pam_unix.so sha512 shadow try_first_pass 6 | 7 | # End /etc/pam.d/system-password 8 | -------------------------------------------------------------------------------- /etc/pam.d/system-session: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/system-session 2 | 3 | session required pam_unix.so 4 | 5 | # End /etc/pam.d/system-session 6 | -------------------------------------------------------------------------------- /etc/passwd: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/bin/false 3 | daemon:x:2:2:daemon:/sbin:/bin/false 4 | adm:x:3:4:adm:/var/adm:/bin/false 5 | lp:x:4:7:lp:/var/spool/lpd:/bin/false 6 | sync:x:5:0:sync:/sbin:/bin/sync 7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 | halt:x:7:0:halt:/sbin:/sbin/halt 9 | mail:x:8:12:mail:/var/spool/mail:/bin/false 10 | news:x:9:13:news:/usr/lib/news:/bin/false 11 | uucp:x:10:14:uucp:/var/spool/uucppublic:/bin/false 12 | operator:x:11:0:operator:/root:/bin/sh 13 | man:x:13:15:man:/usr/share/man:/bin/false 14 | postmaster:x:14:12:postmaster:/var/spool/mail:/bin/false 15 | smmsp:x:209:209:smmsp:/var/spool/mqueue:/bin/false 16 | nobody:x:65534:65534:nobody:/:/bin/false 17 | sshd:x:22:22:sshd:/var/empty:/sbin/nologin 18 | cron:x:16:16:cron:/var/spool/cron:/sbin/nologin 19 | hacluster:x:101:101:ha_cluster user:/var/lib/pacemaker/cores/hacluster:/sbin/nologin 20 | vtl:x:102:102:mhvtl user:/etc/mhvtl:/bin/false 21 | nagios:x:499:498:nagios user:/var/log/nagios:/sbin/nologin 22 | nutmon:x:103:103:nut user:/usr/bin:/bin/false 23 | qemu:x:107:107:qemu user:/:/user/sbin/nologin 24 | -------------------------------------------------------------------------------- /etc/profile: -------------------------------------------------------------------------------- 1 | # Set the title bar 2 | if [[ ${TERM} == xterm* ]] || [[ ${TERM} == vte* ]]; then 3 | echo -ne "\033]0;$(hostname) - $(cat /etc/esos-release)\007" 4 | fi 5 | 6 | # A few settings (include the "real" profile) 7 | if [ "$(whoami)" = "root" ]; then 8 | ulimit -n 10240 9 | fi 10 | ulimit -c unlimited 11 | source /etc/bashrc 12 | 13 | # Make the line characters display correctly for certain emulators 14 | export NCURSES_NO_UTF8_ACS=1 15 | 16 | if [[ $(tty) =~ /dev/ttyS[0-9] ]]; then 17 | # Don't run the TUI if we're connected via serial 18 | echo "Connected via serial ($(tty))..." 19 | : 20 | elif [ -f "/var/state/esos/no_login_tui" ]; then 21 | # Don't run the TUI as requested (build option) 22 | echo "No TUI at login..." 23 | : 24 | else 25 | # Run the TUI binary and if it doesn't exit 26 | # cleanly, fall through to the shell 27 | /usr/local/bin/esos_tui 28 | tui_exit=${?} 29 | if [ ${tui_exit} -eq 0 ]; then 30 | exit 0 31 | else 32 | clear 33 | echo "Something broke; the TUI exited with ${tui_exit}." 34 | fi 35 | fi 36 | -------------------------------------------------------------------------------- /etc/rc.conf: -------------------------------------------------------------------------------- 1 | # Use this file to enable/disable services. 2 | # To enable a service, set the value to "YES". 3 | # To disable a service, set the value to "NO". 4 | 5 | #rc.syslogd_opts="" 6 | rc.haveged_enable=YES 7 | #rc.haveged_opts="-w 1024 -v 0" 8 | rc.openibd_enable=YES 9 | rc.opensm_enable=NO 10 | #rc.opensm_opts="--daemon > /dev/null 2>&1" 11 | rc.lldpad_enable=YES 12 | #rc.lldpad_opts="-d" 13 | rc.sshd_enable=YES 14 | #rc.sshd_opts="-f /etc/ssh/sshd_config" 15 | rc.iscsid_enable=NO 16 | #rc.iscsid_opts="" 17 | rc.multipathd_enable=NO 18 | #rc.multipathd_opts="" 19 | rc.mdraid_enable=YES 20 | #rc.mdraid_opts="--assemble --scan" 21 | rc.lvm2_enable=YES 22 | rc.zfs_enable=YES 23 | rc.eio_enable=NO 24 | rc.dmcache_enable=NO 25 | rc.btier_enable=NO 26 | rc.drbd_enable=NO 27 | rc.rbdmap_enable=NO 28 | rc.virtlogd_enable=NO 29 | #rc.virtlogd_opts="-d" 30 | rc.libvirtd_enable=NO 31 | #rc.libvirtd_opts="-d" 32 | rc.sbd_enable=NO 33 | rc.corosync_enable=NO 34 | #rc.corosync_opts="" 35 | rc.dlm_enable=NO 36 | #rc.dlm_opts="" 37 | rc.lvmlockd_enable=NO 38 | #rc.lvmlockd_opts="-f" 39 | rc.pacemaker_enable=NO 40 | #rc.pacemaker_opts="> /dev/null 2>&1" 41 | rc.fsmount_enable=YES 42 | rc.mhvtl_enable=NO 43 | rc.scst_enable=YES 44 | rc.nvmet_enable=NO 45 | rc.nfsd_enable=NO 46 | #rc.nfsd_opts="-p 2049 8" 47 | rc.nrpe_enable=NO 48 | #rc.nrpe_opts="-c /etc/nrpe.cfg -d > /dev/null 2>&1" 49 | rc.munin_enable=NO 50 | #rc.munin_opts="0.0.0.0:4949" 51 | rc.snmpd_enable=NO 52 | #rc.snmpd_opts="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid > /dev/null 2>&1" 53 | rc.snmptrapd_enable=NO 54 | #rc.snmptrapd_opts="-Lsd -p /var/run/snmptrapd.pid > /dev/null 2>&1" 55 | rc.nut_enable=NO 56 | rc.smartd_enable=NO 57 | #rc.smartd_opts="-q never > /dev/null 2>&1" 58 | rc.stunnel_enable=NO 59 | #rc.stunnel_opts="" 60 | rc.nginx_enable=NO 61 | #rc.nginx_opts="" 62 | rc.telegraf_enable=NO 63 | #rc.telegraf_opts="> /var/log/telegraf.log 2>&1 &" 64 | rc.nodeexporter_enable=NO 65 | #rc.nodeexporter_opts="--log.level error > /var/log/node_exporter.log 2>&1 &" 66 | rc.libvirtdexporter_enable=NO 67 | #rc.libvirtdexporter_opts="> /var/log/libvirtd_exporter.log 2>&1 &" 68 | rc.prometheus_enable=NO 69 | #rc.prometheus_opts="--config.file /etc/prometheus/prometheus.yml --log.level error > /var/log/prometheus.log 2>&1 &" 70 | rc.vmtoolsd_enable=NO 71 | #rc.vmtoolsd_opts="-b /var/run/vmtoolsd.pid" 72 | rc.acpid_enable=YES 73 | #rc.acpid_opts="-l -L /run/acpid.lock" 74 | rc.serial_enable=YES 75 | rc.watchdog_enable=NO 76 | #rc.watchdog_opts="-T 90 /dev/watchdog" 77 | rc.rasdaemon_enable=YES 78 | #rc.rasdaemon_opts="-r" 79 | rc.msmtpd_enable=NO 80 | #rc.msmtpd_opts="" 81 | rc.memcached_enable=NO 82 | #rc.memcached_opts="-u root -d" 83 | 84 | -------------------------------------------------------------------------------- /etc/rc.d/rc.0: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | # Stop the LATE user settable services (reverse order) 6 | for i in $(/bin/echo ${LATE_SERVICES} | /usr/bin/tr ' ' '\n' | \ 7 | /usr/bin/tac | /usr/bin/tr '\n' ' '); do 8 | if check_enabled "${i}"; then 9 | ${RC_D_PREFIX}/${i} status 10 | rc_status=${?} 11 | if [ ${rc_status} -eq ${RUNNING} ] || \ 12 | [ ${rc_status} -eq ${UNKNOWN} ]; then 13 | ${RC_D_PREFIX}/${i} stop 14 | fi 15 | fi 16 | done 17 | 18 | if ! /bin/grep nfs_iso_device /proc/cmdline > /dev/null 2>&1; then 19 | if [ -x /etc/rc.d/rc.network ]; then 20 | /etc/rc.d/rc.network stop 21 | fi 22 | fi 23 | 24 | # Stop the EARLY user settable services (reverse order) 25 | for i in $(/bin/echo ${EARLY_SERVICES} | /usr/bin/tr ' ' '\n' | \ 26 | /usr/bin/tac | /usr/bin/tr '\n' ' '); do 27 | if check_enabled "${i}"; then 28 | ${RC_D_PREFIX}/${i} status 29 | rc_status=${?} 30 | if [ ${rc_status} -eq ${RUNNING} ] || \ 31 | [ ${rc_status} -eq ${UNKNOWN} ]; then 32 | ${RC_D_PREFIX}/${i} stop 33 | fi 34 | fi 35 | done 36 | 37 | if [ -x /etc/rc.d/rc.syslogd ]; then 38 | /etc/rc.d/rc.syslogd stop 39 | fi 40 | 41 | /bin/echo "Sending all processes the TERM signal..." 42 | /sbin/killall5 -15 43 | /bin/sleep 1 44 | 45 | /bin/echo "Sending all processes the KILL signal..." 46 | /sbin/killall5 -9 47 | /bin/sleep 1 48 | 49 | /bin/echo "Saving random seed to a temporary file..." 50 | /bin/dd if=/dev/urandom of=/var/lib/esos/random-seed count=1 bs=512 2> /dev/null 51 | 52 | /bin/echo "Saving the system time to hardware clock..." 53 | /sbin/hwclock --systohc --utc 54 | 55 | # Write wtmp records 56 | case "$0" in 57 | *6) 58 | /sbin/reboot -w 59 | ;; 60 | *0) 61 | /sbin/halt -w 62 | ;; 63 | esac 64 | 65 | if ! /bin/grep esos_iso /proc/cmdline > /dev/null 2>&1; then 66 | /bin/echo "Synchronizing configuration..." 67 | /usr/local/sbin/conf_sync.sh > /dev/null 2>&1 68 | fi 69 | 70 | if ! /bin/grep esos_iso /proc/cmdline > /dev/null 2>&1; then 71 | /bin/echo "Saving log files..." 72 | /usr/local/sbin/archive_logs.sh 73 | fi 74 | 75 | if /bin/grep esos_persist /proc/cmdline > /dev/null 2>&1; then 76 | /bin/echo "Unmounting persistent file systems..." 77 | # Unmount all except for esos_root (it's busy) 78 | for i in /boot /mnt/conf /var/log /mnt/logs /mnt/data; do 79 | if /bin/mountpoint -q ${i}; then 80 | /bin/umount ${i} 81 | fi 82 | done 83 | fi 84 | 85 | if /bin/mountpoint -q /mnt/root; then 86 | md_stop_names="esos_boot|esos_conf|esos_logs|esos_data" 87 | else 88 | md_stop_names="esos_boot|esos_root|esos_conf|esos_logs|esos_data" 89 | fi 90 | mdadm --detail --scan | while read -r row; do 91 | md_path="$(echo ${row} | awk '{ print $2 }')" 92 | fourth_col="$(echo ${row} | awk '{ print $4 }')" 93 | # If an array is rebuilding, the fourth column may not be the "name" field 94 | if /bin/echo "${fourth_col}" | /bin/grep -q "name="; then 95 | md_name="$(echo ${row} | awk '{ print $4 }' | \ 96 | cut -d= -f2 | cut -d: -f2)" 97 | else 98 | md_name="$(echo ${row} | awk '{ print $5 }' | \ 99 | cut -d= -f2 | cut -d: -f2)" 100 | fi 101 | if echo ${md_name} | egrep "${md_stop_names}" > /dev/null; then 102 | mdadm --stop ${md_path} 103 | fi 104 | done 105 | 106 | /bin/echo "Remounting root file system read-only..." 107 | /bin/mount -n -o remount,ro / 108 | 109 | /bin/echo "Flushing file system buffers..." 110 | /bin/sync 111 | 112 | if /bin/grep -E 'esos_iso|esos_persist' /proc/cmdline > /dev/null 2>&1; then 113 | /bin/echo "Attempting to re-mount all remaining file systems read-only..." 114 | /bin/echo "u" > /proc/sysrq-trigger 115 | else 116 | /bin/echo "Unmounting local file systems..." 117 | /bin/umount -l /dev 118 | /bin/umount -a 119 | fi 120 | 121 | case "$0" in 122 | *6) 123 | /bin/echo "Rebooting..." 124 | /sbin/reboot -d -f -i 125 | ;; 126 | *0) 127 | /bin/echo "Bye..." 128 | /sbin/halt -d -f -p 129 | ;; 130 | esac 131 | -------------------------------------------------------------------------------- /etc/rc.d/rc.1: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | # Stop the LATE user settable services (reverse order) 6 | for i in $(/bin/echo ${LATE_SERVICES} | /usr/bin/tr ' ' '\n' | \ 7 | /usr/bin/tac | /usr/bin/tr '\n' ' '); do 8 | if check_enabled "${i}"; then 9 | ${RC_D_PREFIX}/${i} stop 10 | fi 11 | done 12 | 13 | if [ -x /etc/rc.d/rc.network ]; then 14 | /etc/rc.d/rc.network stop 15 | fi 16 | 17 | # Stop the EARLY user settable services (reverse order) 18 | for i in $(/bin/echo ${EARLY_SERVICES} | /usr/bin/tr ' ' '\n' | \ 19 | /usr/bin/tac | /usr/bin/tr '\n' ' '); do 20 | if check_enabled "${i}"; then 21 | ${RC_D_PREFIX}/${i} stop 22 | fi 23 | done 24 | 25 | /bin/echo "Sending all processes the TERM signal..." 26 | /sbin/killall5 -15 27 | /bin/sleep 1 28 | 29 | /bin/echo "Sending all processes the KILL signal..." 30 | /sbin/killall5 -9 31 | /bin/sleep 1 32 | -------------------------------------------------------------------------------- /etc/rc.d/rc.2: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | /bin/echo "Bringing up loopback interface..." 6 | /sbin/ifconfig lo 127.0.0.1 7 | /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo 8 | 9 | # Start the EARLY user settable services 10 | for i in ${EARLY_SERVICES}; do 11 | if check_enabled "${i}"; then 12 | ${RC_D_PREFIX}/${i} start 13 | fi 14 | done 15 | 16 | if [ -f "/etc/crypttab" ]; then 17 | /bin/echo "Starting disk encryption (early)..." 18 | init_crypto 1 19 | fi 20 | 21 | /bin/echo "Loading the Brocade 10G Ethernet driver..." 22 | /sbin/modprobe bna 23 | 24 | /bin/echo "Loading the Mellanox ConnectX-4 and Connect-IB core driver..." 25 | /sbin/modprobe mlx5_core 26 | 27 | /bin/echo "Loading the QLogic FastLinQ 4xxxx Ethernet driver..." 28 | /sbin/modprobe qede 29 | 30 | /bin/echo "Loading the Broadcom NetXtreme Ethernet driver..." 31 | /sbin/modprobe bnxt_en 32 | 33 | /bin/echo "Loading the Microsemi Switchtec NTB driver..." 34 | /sbin/modprobe ntb_hw_switchtec 35 | /sbin/modprobe cls_switchtec 36 | 37 | /bin/echo "Loading the Virtual Ethernet over NTB Transport driver..." 38 | /sbin/modprobe -s ntb_netdev 39 | 40 | /bin/echo "Loading the Linux Ethernet Bonding driver..." 41 | /sbin/modprobe bonding 42 | 43 | if [ -x /etc/rc.d/rc.network ]; then 44 | /etc/rc.d/rc.network start 45 | fi 46 | 47 | if [ -x /etc/rc.d/rc.syslogd ]; then 48 | if /usr/bin/pidof /usr/sbin/syslogd > /dev/null; then 49 | /etc/rc.d/rc.syslogd stop 50 | fi 51 | /etc/rc.d/rc.syslogd start 52 | fi 53 | 54 | /bin/echo "Starting vixie-cron..." 55 | /usr/sbin/cron 56 | 57 | if [ -s /etc/ntp_server ]; then 58 | /bin/echo "Setting system date/time via NTP..." 59 | /usr/sbin/ntpd -n -q -N -p `/bin/cat /etc/ntp_server` 60 | fi 61 | 62 | if ! /bin/grep esos_iso /proc/cmdline > /dev/null 2>&1; then 63 | if [ -x /etc/rc.d/rc.kdump ]; then 64 | /bin/echo "Loading crash dump kernel (kexec)..." 65 | /etc/rc.d/rc.kdump 66 | fi 67 | fi 68 | 69 | /bin/echo "Loading the QLogic Fibre Channel HBA module..." 70 | if [ -f "/lib/modules/$(/bin/uname -r)/extra/qla2xxx_scst.ko" ]; then 71 | /sbin/modprobe qla2xxx_scst 72 | else 73 | /sbin/modprobe qla2xxx 74 | fi 75 | /bin/sleep 5 76 | 77 | if [ -f "/lib/modules/$(/bin/uname -r)/extra/celerity16fc.ko" ]; then 78 | /bin/echo "Loading the ATTO Celerity 16Gb/32Gb FC HBA module..." 79 | /sbin/modprobe -s celerity16fc 80 | fi 81 | 82 | /bin/echo "Starting irqbalance..." 83 | /usr/sbin/irqbalance 84 | 85 | /bin/echo "Fixing /opt/sbin permissions..." 86 | for i in $(/bin/ls /opt/sbin); do 87 | if [ ! -x "/opt/sbin/${i}" ]; then 88 | /bin/chmod +x /opt/sbin/${i} 89 | fi 90 | done 91 | 92 | /bin/echo "Loading the bcache module..." 93 | /sbin/modprobe bcache 94 | 95 | if [ -f "/lib/modules/$(/bin/uname -r)/extra/zfs/zfs.ko" ]; then 96 | /bin/echo "Loading the ZFS module..." 97 | /sbin/modprobe zfs 98 | /bin/echo "Starting the ZFS Event Daemon..." 99 | /usr/sbin/zed -p /var/run/zed.pid 100 | fi 101 | 102 | /bin/echo "Loading the NVMeoF target modules..." 103 | /sbin/modprobe nvmet-rdma 104 | /sbin/modprobe nvmet-fc 105 | /sbin/modprobe nvmet-tcp 106 | /bin/echo 5 > /sys/module/nvme_core/parameters/admin_timeout 107 | 108 | if [ -f "/lib/modules/$(/bin/uname -r)/extra/nvme_qla2xxx.ko" ]; then 109 | /bin/echo "Loading the QLogic NVMe Target module..." 110 | /sbin/modprobe nvme_qla2xxx 111 | fi 112 | 113 | # Start the LATE user settable services 114 | for i in ${LATE_SERVICES}; do 115 | if check_enabled "${i}"; then 116 | ${RC_D_PREFIX}/${i} start 117 | fi 118 | done 119 | 120 | if [ -f "/etc/crypttab" ]; then 121 | /bin/echo "Starting disk encryption (late)..." 122 | init_crypto 1 123 | fi 124 | 125 | /bin/echo "Executing /etc/rc.local..." 126 | if [ -f /etc/rc.local ]; then 127 | /bin/sh /etc/rc.local 128 | fi 129 | 130 | # For a nice pretty login screen 131 | /usr/bin/clear 132 | -------------------------------------------------------------------------------- /etc/rc.d/rc.acpid: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | ACPID="/usr/sbin/acpid" 6 | ACPID_LOCK="/var/lock/acpid" 7 | DFLT_OPTS="-l -L /run/acpid.lock" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting acpid..." 24 | eval ${ACPID} ${USER_OPTS} || exit 1 25 | /bin/touch ${ACPID_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping acpid..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${ACPID}) || exit 1 31 | wait_for_stop ${ACPID} && /bin/rm -f ${ACPID_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${ACPID} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.btier: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | BTTAB="/etc/bttab" 6 | BTIER_SETUP="/usr/sbin/btier_setup" 7 | 8 | check_args ${@} 9 | 10 | start() { 11 | /bin/echo "Loading btier devices..." 12 | # Make sure the module is loaded 13 | /sbin/modprobe btier || exit 1 14 | # Wait for load 15 | while : ; do 16 | /sbin/lsmod | /bin/grep btier >& /dev/null 17 | [[ ${?} -eq 1 ]] || break 18 | done 19 | # Loop over the bttab file and setup devices 20 | for i in `/bin/cat ${BTTAB} | /bin/grep -v "^#"`; do 21 | ${BTIER_SETUP} -f ${i} 22 | if [ ${?} != 0 ]; then 23 | /bin/echo "Failed to setup btier device: ${BTIER_SETUP} -f ${i}" 24 | exit 1 25 | fi 26 | done 27 | } 28 | 29 | stop() { 30 | /bin/echo "Unloading btier devices..." 31 | # Loop over the bttab file and deregister devices 32 | for i in `/bin/ls /dev/sdtier* | /usr/bin/sort -r`; do 33 | ${BTIER_SETUP} -d ${i} 34 | if [ ${?} != 0 ]; then 35 | /bin/echo "Failed to deregister btier device: ${BTIER_SETUP} -d ${i}" 36 | exit 1 37 | fi 38 | done 39 | # Unload the btier module 40 | /sbin/rmmod -w btier 41 | } 42 | 43 | status() { 44 | if /bin/grep btier /proc/modules > /dev/null 2>&1; then 45 | exit ${RUNNING} 46 | else 47 | exit ${STOPPED} 48 | fi 49 | } 50 | 51 | # Perform specified action 52 | ${1} 53 | -------------------------------------------------------------------------------- /etc/rc.d/rc.corosync: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | COROSYNC="/usr/sbin/corosync" 6 | COROSYNC_LOCK="/var/lock/corosync" 7 | RC_COROSYNC_LOGGER="/usr/bin/logger -t rc.corosync -p daemon.info" 8 | DFLT_OPTS="" 9 | 10 | check_args ${@} 11 | 12 | SCRIPT="$(/usr/bin/basename ${0})" 13 | if check_opts_set ${SCRIPT}; then 14 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 15 | if [ ${?} -ne 0 ]; then 16 | /bin/echo ${USER_OPTS} 17 | exit 1 18 | fi 19 | else 20 | USER_OPTS="${DFLT_OPTS}" 21 | fi 22 | 23 | start() { 24 | if check_enabled "rc.sbd"; then 25 | if ! /etc/rc.d/rc.sbd status; then 26 | /bin/echo "SBD is not running, skipping Corosync start!" 27 | exit 1 28 | fi 29 | fi 30 | /bin/echo "Starting corosync..." 31 | eval ${COROSYNC} ${USER_OPTS} || exit 1 32 | /bin/touch ${COROSYNC_LOCK} 33 | /bin/sleep 1 34 | } 35 | 36 | stop() { 37 | /bin/echo "Stopping corosync..." 38 | /usr/bin/kill -TERM $(/usr/bin/pidof ${COROSYNC}) || exit 1 39 | wait_for_stop ${COROSYNC} && /bin/rm -f ${COROSYNC_LOCK} 40 | } 41 | 42 | status() { 43 | /usr/bin/pidof ${COROSYNC} > /dev/null 2>&1 44 | exit ${?} 45 | } 46 | 47 | # Perform specified action 48 | ${1} 49 | -------------------------------------------------------------------------------- /etc/rc.d/rc.dlm: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | DLM_CONTROLD="/usr/sbin/dlm_controld" 6 | DLM_CONTROLD_LOCK="/var/lock/dlm_controld" 7 | DFLT_OPTS="" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting dlm_controld..." 24 | eval ${DLM_CONTROLD} ${USER_OPTS} || exit 1 25 | /bin/touch ${DLM_CONTROLD_LOCK} 26 | /bin/sleep 1 27 | } 28 | 29 | stop() { 30 | /bin/echo "Stopping dlm_controld..." 31 | /usr/bin/kill -TERM $(/usr/bin/pidof ${DLM_CONTROLD}) || exit 1 32 | wait_for_stop ${DLM_CONTROLD} && /bin/rm -f ${DLM_CONTROLD_LOCK} 33 | } 34 | 35 | status() { 36 | /usr/bin/pidof ${DLM_CONTROLD} > /dev/null 2>&1 37 | exit ${?} 38 | } 39 | 40 | # Perform specified action 41 | ${1} 42 | -------------------------------------------------------------------------------- /etc/rc.d/rc.dmcache: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | DMCACHE_START="/etc/dm-cache.start" 6 | DMCACHE_STOP="/etc/dm-cache.stop" 7 | 8 | check_args ${@} 9 | 10 | start() { 11 | # If our dm-cache.start file exists, run it 12 | if [ -f ${DMCACHE_START} ]; then 13 | /bin/echo "Found the dm-cache start script; running..." 14 | /bin/sh ${DMCACHE_START} 15 | else 16 | /bin/echo "The dm-cache start script wasn't found!" 17 | exit 1 18 | fi 19 | } 20 | 21 | stop() { 22 | # If our dm-cache.stop file exists, run it 23 | if [ -f ${DMCACHE_STOP} ]; then 24 | /bin/echo "Found the dm-cache stop script; running..." 25 | /bin/sh ${DMCACHE_STOP} 26 | else 27 | /bin/echo "The dm-cache stop script wasn't found!" 28 | exit 1 29 | fi 30 | } 31 | 32 | status() { 33 | # We don't know anything 34 | exit ${UNKNOWN} 35 | } 36 | 37 | # Perform specified action 38 | ${1} 39 | -------------------------------------------------------------------------------- /etc/rc.d/rc.drbd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | DRBDADM="/sbin/drbdadm" 6 | DEV_TIMEOUT=10 7 | PROC_DRBD="/proc/drbd" 8 | 9 | check_args ${@} 10 | 11 | # Suppress version mismatch warnings 12 | export DRBD_DONT_WARN_ON_VERSION_MISMATCH=1 13 | 14 | start() { 15 | /bin/echo "Setting DRBD parameters..." 16 | ${DRBDADM} adjust all 17 | 18 | /bin/echo "Waiting for device creation..." 19 | for i in `${DRBDADM} sh-resources`; do 20 | for j in `${DRBDADM} sh-dev ${i}`; do 21 | dev_timeout_local=${DEV_TIMEOUT} 22 | while [ ! -e ${j} ] && [ ${dev_timeout_local} -gt 0 ] ; do 23 | /bin/sleep 1 24 | dev_timeout_local=$(( ${dev_timeout_local}-1 )) 25 | done 26 | done 27 | done 28 | 29 | /bin/echo "Waiting for connection..." 30 | ${DRBDADM} wait-con-int 31 | } 32 | 33 | stop() { 34 | /bin/echo "Stopping all DRBD resources..." 35 | if ! grep -q '^/dev/drbd' /proc/mounts &> /dev/null; then 36 | if [ -e ${PROC_DRBD} ]; then 37 | ${DRBDADM} down all 38 | fi 39 | else 40 | /bin/echo "DRBD devices mounted; please unmount them before trying to stop DRBD!" 41 | fi 42 | } 43 | 44 | status() { 45 | # We don't know anything 46 | exit ${UNKNOWN} 47 | } 48 | 49 | # Perform specified action 50 | ${1} 51 | -------------------------------------------------------------------------------- /etc/rc.d/rc.fsmount: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source /etc/rc.d/common 4 | 5 | FSTAB="/etc/fstab" 6 | 7 | check_args ${@} 8 | 9 | start() { 10 | # Check file systems for any possible errors 11 | if [ "x${ESOS_PERSIST}" != "x1" ]; then 12 | /bin/echo "Checking all file systems..." 13 | fi 14 | while read -r fstab_line; do 15 | device="$(/bin/echo "${fstab_line}" | /usr/bin/awk '{print $1}')" 16 | mnt_point="$(/bin/echo "${fstab_line}" | /usr/bin/awk '{print $2}')" 17 | if [ "x${ESOS_PERSIST}" = "x1" ]; then 18 | # Early call for ESOS "persistent mode" 19 | if /bin/echo "${device}" | /bin/grep -q -E "esos_|ESOS_"; then 20 | if ! /sbin/findfs "${device}" > /dev/null 2>&1; then 21 | /bin/echo "Unable to resolve '${device}', skipping..." 22 | continue 23 | fi 24 | else 25 | continue 26 | fi 27 | else 28 | # Normal use in LATE_SERVICES 29 | if /bin/echo "${device}" | /bin/grep -q -E \ 30 | 'devtmpfs|proc|sysfs|devpts|tmpfs'; then 31 | # Don't check these 32 | continue 33 | fi 34 | if /bin/echo "${device}" | /bin/grep -q -E "esos_|ESOS_" && \ 35 | ! /sbin/findfs "${device}" > /dev/null 2>&1; then 36 | # Don't check ESOS file system devices that are absent 37 | continue 38 | fi 39 | fi 40 | /usr/sbin/fsck -M -T -p "${device}" 41 | if [ ${?} -gt 1 ]; then 42 | /bin/echo "ERROR (${device}): Your file system appears to be" \ 43 | "severely damaged." 44 | /bin/echo "ERROR (${device}): You can probably correct this" \ 45 | "problem by running fsck.FSTYPE manually." 46 | fi 47 | if [ "x${ESOS_PERSIST}" = "x1" ]; then 48 | # If we made it this far with ESOS_PERSIST=1 then mount it 49 | if ! /bin/mountpoint -q ${mnt_point}; then 50 | /bin/mount ${mnt_point} 51 | fi 52 | fi 53 | done <<< "$(/bin/cat ${FSTAB})" 54 | 55 | if [ "x${ESOS_PERSIST}" != "x1" ]; then 56 | # Mount the file systems 57 | /bin/echo "Mounting local file systems..." 58 | for i in $(/usr/bin/awk '{print $2}' ${FSTAB}); do 59 | if [ "${i:0:1}" == "/" ]; then 60 | if [ ! -d "${i}" ]; then 61 | /bin/mkdir -p "${i}" 62 | fi 63 | fi 64 | done 65 | /bin/mount -a 66 | fi 67 | } 68 | 69 | stop() { 70 | # Do nothing 71 | : 72 | } 73 | 74 | status() { 75 | # We don't know anything 76 | exit ${UNKNOWN} 77 | } 78 | 79 | # Perform specified action 80 | ${1} 81 | -------------------------------------------------------------------------------- /etc/rc.d/rc.haveged: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | HAVEGED="/usr/sbin/haveged" 6 | HAVEGED_LOCK="/var/lock/haveged" 7 | DFLT_OPTS="-w 1024 -v 0" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting haveged..." 24 | eval ${HAVEGED} ${USER_OPTS} || exit 1 25 | /bin/touch ${HAVEGED_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping haveged..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${HAVEGED}) || exit 1 31 | wait_for_stop ${HAVEGED} && /bin/rm -f ${HAVEGED_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${HAVEGED} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.iscsid: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | ISCSID="/sbin/iscsid" 6 | ISCSID_LOCK="/var/lock/iscsid" 7 | ISCSIADM="/sbin/iscsiadm" 8 | SYNC="/bin/sync" 9 | INAME_FILE="/etc/iscsi/initiatorname.iscsi" 10 | ISCSI_INAME="/sbin/iscsi-iname" 11 | DFLT_OPTS="" 12 | 13 | check_args ${@} 14 | 15 | SCRIPT="$(/usr/bin/basename ${0})" 16 | if check_opts_set ${SCRIPT}; then 17 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 18 | if [ ${?} -ne 0 ]; then 19 | /bin/echo ${USER_OPTS} 20 | exit 1 21 | fi 22 | else 23 | USER_OPTS="${DFLT_OPTS}" 24 | fi 25 | 26 | start() { 27 | if [ ! -f "${INAME_FILE}" ]; then 28 | /bin/echo "Generating unique iSCSI initiator name..." 29 | /bin/echo "InitiatorName=`${ISCSI_INAME}`" > ${INAME_FILE} || exit 1 30 | fi 31 | /bin/echo "Starting iSCSI initiator service..." 32 | eval ${ISCSID} ${USER_OPTS} || exit 1 33 | /bin/touch ${ISCSID_LOCK} 34 | /bin/echo "Setting up iSCSI targets..." 35 | /bin/sh -c "/usr/bin/nohup ${ISCSIADM} -m node \ 36 | --loginall=automatic > /dev/null 2>&1 &" 37 | } 38 | 39 | stop() { 40 | /bin/echo "Stopping iSCSI initiator service..." 41 | ${SYNC} 42 | ${ISCSIADM} -m node --logoutall=all 43 | ${ISCSIADM} -k 0 && /bin/rm -f ${ISCSID_LOCK} 44 | } 45 | 46 | status() { 47 | /usr/bin/pidof ${ISCSID} > /dev/null 2>&1 48 | exit ${?} 49 | } 50 | 51 | # Perform specified action 52 | ${1} 53 | -------------------------------------------------------------------------------- /etc/rc.d/rc.kdump: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # From: https://wiki.gentoo.org/wiki/Custom_Initramfs 4 | cmdline() { 5 | local value 6 | value=" $(cat /proc/cmdline) " 7 | value="${value##* $1=}" 8 | value="${value%% *}" 9 | [ "$value" != "" ] && echo "$value" 10 | } 11 | 12 | # Get the slot kernel parameter 13 | slot_name="$(cmdline slot)" 14 | if [ -z "${slot_name}" ]; then 15 | echo "Is the slot= kernel parameter missing?" 16 | exit 1 17 | fi 18 | 19 | # Systems with lots of CPUs need nr_cpus > 1 in the capture kernel 20 | avail_cpus="$(/usr/bin/nproc --all)" 21 | if [ ${avail_cpus} -ge 64 ]; then 22 | nr_cpus="16" 23 | else 24 | nr_cpus="1" 25 | fi 26 | 27 | if ! /bin/grep esos_persist /proc/cmdline > /dev/null 2>&1; then 28 | # Need the boot file system so we can load a kernel 29 | /bin/mount /boot || exit 1 30 | fi 31 | 32 | # Load a kernel (prod or debug) for use on panic 33 | case "`/bin/uname -r`" in 34 | *prod*) 35 | kernel=/boot/${slot_name}-bzImage-esos.prod 36 | initramfs=/boot/${slot_name}-initramfs.cpio.gz 37 | /usr/sbin/kexec -p ${kernel} --initrd=${initramfs} \ 38 | --append="single irqpoll nr_cpus=${nr_cpus} reset_devices" 39 | ;; 40 | *debug*) 41 | kernel=/boot/${slot_name}-bzImage-esos.debug 42 | initramfs=/boot/${slot_name}-initramfs.cpio.gz 43 | /usr/sbin/kexec -p ${kernel} --initrd=${initramfs} \ 44 | --append="single irqpoll nr_cpus=${nr_cpus} reset_devices" 45 | ;; 46 | esac 47 | 48 | # Done 49 | if ! /bin/grep esos_persist /proc/cmdline > /dev/null 2>&1; then 50 | /bin/umount /boot || exit 1 51 | fi 52 | 53 | -------------------------------------------------------------------------------- /etc/rc.d/rc.libvirtd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | LIBVIRTD="/usr/sbin/libvirtd" 6 | LIBVIRTD_LOCK="/var/lock/libvirtd" 7 | DFLT_OPTS="-d" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting libvirtd..." 24 | eval ${LIBVIRTD} ${USER_OPTS} || exit 1 25 | /bin/touch ${LIBVIRTD_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping libvirtd..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${LIBVIRTD}) || exit 1 31 | wait_for_stop ${LIBVIRTD} && /bin/rm -f ${LIBVIRTD_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${LIBVIRTD} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.libvirtdexporter: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | LIBVIRTD_EXPORTER="/usr/bin/libvirtd_exporter" 6 | LIBVIRTD_EXPORTER_LOCK="/var/lock/libvirtd_exporter" 7 | DFLT_OPTS="> /var/log/libvirtd_exporter.log 2>&1 &" 8 | PWATCHER="/usr/local/sbin/pwatcher.sh" 9 | 10 | check_args ${@} 11 | 12 | SCRIPT="$(/usr/bin/basename ${0})" 13 | if check_opts_set ${SCRIPT}; then 14 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 15 | if [ ${?} -ne 0 ]; then 16 | /bin/echo ${USER_OPTS} 17 | exit 1 18 | fi 19 | else 20 | USER_OPTS="${DFLT_OPTS}" 21 | fi 22 | 23 | start() { 24 | /bin/echo "Starting libvirtd_exporter..." 25 | eval ${PWATCHER} \"\" ${LIBVIRTD_EXPORTER_LOCK} \ 26 | ${LIBVIRTD_EXPORTER} ${USER_OPTS} || exit 1 27 | # The pwatcher script creates the lock file 28 | } 29 | 30 | stop() { 31 | /bin/echo "Stopping libvirtd_exporter..." 32 | # Stop the pwatcher process that is monitoring this script and it will stop 33 | pwatcher_pids=$(/usr/bin/pidof -x -o %PPID "$(basename ${PWATCHER})") 34 | for pwatcher_pid in ${pwatcher_pids}; do 35 | if grep -q "${LIBVIRTD_EXPORTER}" "/proc/${pwatcher_pid}/cmdline"; then 36 | /usr/bin/kill -TERM "${pwatcher_pid}" 37 | wait_for_pid_stop "${pwatcher_pid}" && \ 38 | /bin/rm -f ${LIBVIRTD_EXPORTER_LOCK} 39 | fi 40 | done 41 | } 42 | 43 | status() { 44 | /usr/bin/pidof ${LIBVIRTD_EXPORTER} > /dev/null 2>&1 45 | exit ${?} 46 | } 47 | 48 | # Perform specified action 49 | ${1} 50 | -------------------------------------------------------------------------------- /etc/rc.d/rc.lldpad: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | LLDPAD="/usr/sbin/lldpad" 6 | LLDPAD_LOCK="/var/lock/lldpad" 7 | FCOEMON="/usr/sbin/fcoemon" 8 | FCOEMON_LOCK="/var/lock/fcoemon" 9 | DFLT_OPTS="-d" 10 | 11 | check_args ${@} 12 | 13 | SCRIPT="$(/usr/bin/basename ${0})" 14 | if check_opts_set ${SCRIPT}; then 15 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 16 | if [ ${?} -ne 0 ]; then 17 | /bin/echo ${USER_OPTS} 18 | exit 1 19 | fi 20 | else 21 | USER_OPTS="${DFLT_OPTS}" 22 | fi 23 | 24 | start() { 25 | /bin/echo "Starting lldpad..." 26 | eval ${LLDPAD} ${USER_OPTS} || exit 1 27 | /bin/touch ${LLDPAD_LOCK} 28 | } 29 | 30 | stop() { 31 | if [ -n "$(/usr/bin/pidof ${FCOEMON})" ]; then 32 | /bin/echo "The 'fcoemon' daemon is running, stopping..." 33 | /usr/bin/kill -TERM $(/usr/bin/pidof ${FCOEMON}) || exit 1 34 | wait_for_stop ${FCOEMON} && /bin/rm -f ${FCOEMON_LOCK} 35 | fi 36 | /bin/echo "Stopping lldpad..." 37 | /usr/bin/kill -TERM $(/usr/bin/pidof ${LLDPAD}) || exit 1 38 | wait_for_stop ${LLDPAD} && /bin/rm -f ${LLDPAD_LOCK} 39 | } 40 | 41 | status() { 42 | /usr/bin/pidof ${LLDPAD} > /dev/null 2>&1 43 | exit ${?} 44 | } 45 | 46 | # Perform specified action 47 | ${1} 48 | -------------------------------------------------------------------------------- /etc/rc.d/rc.lvm2: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | DMSETUP="/usr/sbin/dmsetup" 6 | VGSCAN="/usr/sbin/vgscan" 7 | VGCHANGE="/usr/sbin/vgchange" 8 | 9 | check_args ${@} 10 | 11 | start() { 12 | # Setup LVM 13 | /bin/echo "Configuring the LVM subsystem..." 14 | # TODO: Running 'dmsetup mknodes' can sometimes cause an issue where it 15 | # seems to create the LVM LV /dev/mapper/ entries itself, and then udev is 16 | # mad because the symlink already exists. Everything seems to work fine 17 | # with this commented out, so if that proves true for a while we can then 18 | # remove this note and the commented out line! 19 | #${DMSETUP} mknodes || exit 1 20 | ${VGSCAN} --ignorelockingfailure || exit 1 21 | ${VGCHANGE} -aay --ignorelockingfailure || exit 1 22 | } 23 | 24 | stop() { 25 | # Deactivate all volume groups 26 | /bin/echo "Deactivating all LVM volume groups..." 27 | ${VGCHANGE} -an || exit 1 28 | } 29 | 30 | status() { 31 | # We don't know anything 32 | exit "${UNKNOWN}" 33 | } 34 | 35 | # Perform specified action 36 | ${1} 37 | -------------------------------------------------------------------------------- /etc/rc.d/rc.lvmlockd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | LVMLOCKD="/usr/sbin/lvmlockd" 6 | LVMLOCKD_LOCK="/var/lock/lvmlockd" 7 | VGCHANGE="/usr/sbin/vgchange" 8 | LVMLOCKCTL="/usr/sbin/lvmlockctl" 9 | DFLT_OPTS="-f" 10 | 11 | check_args ${@} 12 | 13 | SCRIPT="$(/usr/bin/basename ${0})" 14 | if check_opts_set ${SCRIPT}; then 15 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 16 | if [ ${?} -ne 0 ]; then 17 | /bin/echo ${USER_OPTS} 18 | exit 1 19 | fi 20 | else 21 | USER_OPTS="${DFLT_OPTS}" 22 | fi 23 | 24 | start() { 25 | # Start the LVM locking daemon 26 | /bin/echo "Starting lvmlockd..." 27 | eval ${LVMLOCKD} ${USER_OPTS} || exit 1 28 | /bin/touch ${LVMLOCKD_LOCK} 29 | # Setup LVM 30 | /bin/echo "Starting LVM lockspaces..." 31 | ${VGCHANGE} --lock-start --lock-opt autowait || exit 1 32 | /bin/echo "Activating LVM LVs..." 33 | ${VGCHANGE} -aay -S 'locktype=sanlock || locktype=dlm' || exit 1 34 | # Make partition nodes 35 | /bin/echo "Probing logical volumes for partitions..." 36 | for i in $(/usr/sbin/lvs --noheadings -o lv_path --rows); do 37 | /usr/sbin/partprobe ${i} 38 | done 39 | } 40 | 41 | stop() { 42 | /bin/echo "Deactivating LVM LVs..." 43 | ${VGCHANGE} -an -S 'locktype=sanlock || locktype=dlm' || exit 1 44 | /bin/echo "Stopping LVM lockspaces..." 45 | ${LVMLOCKCTL} --stop-lockspaces --wait 1 || exit 1 46 | /bin/echo "Stopping lvmlockd..." 47 | /usr/bin/kill -TERM $(/usr/bin/pidof ${LVMLOCKD}) || exit 1 48 | wait_for_stop ${LVMLOCKD} && /bin/rm -f ${LVMLOCKD_LOCK} 49 | } 50 | 51 | status() { 52 | /usr/bin/pidof ${LVMLOCKD} > /dev/null 2>&1 53 | exit ${?} 54 | } 55 | 56 | # Perform specified action 57 | ${1} 58 | -------------------------------------------------------------------------------- /etc/rc.d/rc.mdraid: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | MDADM="/sbin/mdadm" 6 | DFLT_OPTS="--assemble --scan" 7 | 8 | check_args ${@} 9 | 10 | SCRIPT="$(/usr/bin/basename ${0})" 11 | if check_opts_set ${SCRIPT}; then 12 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 13 | if [ ${?} -ne 0 ]; then 14 | /bin/echo ${USER_OPTS} 15 | exit 1 16 | fi 17 | else 18 | USER_OPTS="${DFLT_OPTS}" 19 | fi 20 | 21 | start() { 22 | /bin/echo "Assembling software RAID devices..." 23 | eval ${MDADM} ${USER_OPTS} || exit 1 24 | } 25 | 26 | stop() { 27 | /bin/echo "Stopping MD RAID arrays..." 28 | # We do two runs to handle "nested" MD RAID arrays 29 | for i in 1 2; do 30 | ${MDADM} --detail --scan | while read -r row; do 31 | md_path="$(echo "${row}" | awk '{ print $2 }')" 32 | md_name="$(echo "${row}" | awk '{ print $4 }' | \ 33 | cut -d= -f2 | cut -d: -f2)" 34 | # We can't stop nested MD RAID arrays that have member arrays 35 | md_device="$(readlink -f "${md_path}")" 36 | short_md="$(echo "${md_device}" | cut -d/ -f3)" 37 | if find "/sys/block/${short_md}/holders/" \ 38 | -type l -name 'md*' | grep -q .; then 39 | continue 40 | fi 41 | # Only stop arrays that aren't the ESOS boot media 42 | if ! echo "${md_name}" | \ 43 | grep -E 'esos_boot|esos_root|esos_conf|esos_logs|esos_data' \ 44 | > /dev/null; then 45 | ${MDADM} --stop "${md_path}" || exit 1 46 | fi 47 | done 48 | done 49 | } 50 | 51 | status() { 52 | # We don't know anything 53 | exit "${UNKNOWN}" 54 | } 55 | 56 | # Perform specified action 57 | ${1} 58 | -------------------------------------------------------------------------------- /etc/rc.d/rc.memcached: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | MEMCACHED="/usr/bin/memcached" 6 | MEMCACHED_LOCK="/var/lock/memcached" 7 | DFLT_OPTS="" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting memcached..." 24 | eval ${MEMCACHED} ${USER_OPTS} || exit 1 25 | /bin/touch ${MEMCACHED_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping memcached..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${MEMCACHED}) || exit 1 31 | wait_for_stop ${MEMCACHED} && /bin/rm -f ${MEMCACHED_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${MEMCACHED} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.mhvtl: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | VTL_USER="vtl" 6 | MHVTL_CONFIG_PATH="/etc/mhvtl" 7 | 8 | check_args ${@} 9 | 10 | start() { 11 | /bin/echo "Starting mhVTL services..." 12 | # Make sure the mhVTL user can read/write 13 | /bin/chown -R ${VTL_USER} ${MHVTL_CONFIG_PATH} 14 | # Load the mhVTL module 15 | /sbin/modprobe mhvtl || exit 1 16 | # Build the library media 17 | /usr/bin/make_vtl_media ${VTL_USER} 18 | # Build the library configuration 19 | /usr/bin/build_library_config ${VTL_USER} 20 | } 21 | 22 | stop() { 23 | /bin/echo "Stopping mhVTL services..." 24 | # Close drive tapes 25 | for i in `ps -eo args | awk '/^vtltape -q/ {print $3}'`; do 26 | /usr/bin/vtlcmd ${i} exit 27 | /bin/usleep 100 28 | done 29 | # Close libraries 30 | for i in `ps -eo args | awk '/^vtllibrary -q/ {print $3}'`; do 31 | /usr/bin/vtlcmd ${i} exit 32 | /bin/usleep 100 33 | done 34 | } 35 | 36 | status() { 37 | if /bin/grep mhvtl /proc/modules > /dev/null 2>&1; then 38 | exit ${RUNNING} 39 | else 40 | exit ${STOPPED} 41 | fi 42 | } 43 | 44 | # Perform specified action 45 | ${1} 46 | -------------------------------------------------------------------------------- /etc/rc.d/rc.msmtpd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | MSMTPD="/usr/bin/msmtpd" 6 | MSMTPD_LOCK="/var/lock/msmtpd" 7 | DFLT_OPTS="" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting msmtpd..." 24 | eval ${MSMTPD} ${USER_OPTS} || exit 1 25 | /bin/touch ${MSMTPD_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping msmtpd..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${MSMTPD}) || exit 1 31 | wait_for_stop ${MSMTPD} && /bin/rm -f ${MSMTPD_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${MSMTPD} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.multipathd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | MULTIPATHD="/usr/sbin/multipathd" 6 | MULTIPATHD_LOCK="/var/lock/multipathd" 7 | DFLT_OPTS="" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting multipathd..." 24 | eval ${MULTIPATHD} ${USER_OPTS} || exit 1 25 | /bin/touch ${MULTIPATHD_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping multipathd..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${MULTIPATHD}) || exit 1 31 | wait_for_stop ${MULTIPATHD} && /bin/rm -f ${MULTIPATHD_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${MULTIPATHD} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.munin: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | MUNIN_INETD="/usr/sbin/munin-inetd-c" 6 | MUNIN_NODE="/usr/sbin/munin-node-c" 7 | MUNIN_LOCK="/var/lock/munin" 8 | DFLT_OPTS="0.0.0.0:4949" 9 | 10 | check_args ${@} 11 | 12 | SCRIPT="$(/usr/bin/basename ${0})" 13 | if check_opts_set ${SCRIPT}; then 14 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 15 | if [ ${?} -ne 0 ]; then 16 | /bin/echo ${USER_OPTS} 17 | exit 1 18 | fi 19 | else 20 | USER_OPTS="${DFLT_OPTS}" 21 | fi 22 | 23 | start() { 24 | /bin/echo "Starting munin-node..." 25 | /bin/sh -c "/usr/bin/nohup ${MUNIN_INETD} ${USER_OPTS} ${MUNIN_NODE} &" 26 | /bin/touch ${MUNIN_LOCK} 27 | /bin/sleep 1 28 | } 29 | 30 | stop() { 31 | /bin/echo "Stopping munin-node..." 32 | /usr/bin/kill -15 $(/usr/bin/pidof ${MUNIN_INETD}) || exit 1 33 | wait_for_stop ${MUNIN_INETD} && /bin/rm -f ${MUNIN_LOCK} 34 | } 35 | 36 | status() { 37 | /usr/bin/pidof ${MUNIN_INETD} > /dev/null 2>&1 38 | exit ${?} 39 | } 40 | 41 | # Perform specified action 42 | ${1} 43 | -------------------------------------------------------------------------------- /etc/rc.d/rc.nfsd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | RPCBIND="/sbin/rpcbind" 6 | RPCBIND_LOCK="/var/lock/rpcbind" 7 | RPC_STATD="/usr/sbin/rpc.statd" 8 | RPC_STATD_LOCK="/var/lock/rpc.statd" 9 | RPC_NFSD="/usr/sbin/rpc.nfsd" 10 | RPC_NFSD_LOCK="/var/lock/rpc.nfsd" 11 | RPC_MOUNTD="/usr/sbin/rpc.mountd" 12 | RPC_MOUNTD_LOCK="/var/lock/rpc.mountd" 13 | EXPORTFS="/usr/sbin/exportfs" 14 | DFLT_OPTS="-p 2049 8" 15 | 16 | check_args ${@} 17 | 18 | SCRIPT="$(/usr/bin/basename ${0})" 19 | if check_opts_set ${SCRIPT}; then 20 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 21 | if [ ${?} -ne 0 ]; then 22 | /bin/echo ${USER_OPTS} 23 | exit 1 24 | fi 25 | else 26 | USER_OPTS="${DFLT_OPTS}" 27 | fi 28 | 29 | start() { 30 | # The rpcbind daemon is needed first 31 | /bin/echo "Starting rpcbind..." 32 | ${RPCBIND} || exit 1 33 | /bin/touch ${RPCBIND_LOCK} 34 | # Now start statd 35 | /bin/echo "Starting NFS statd..." 36 | ${RPC_STATD} --no-notify || exit 1 37 | /bin/touch ${RPC_STATD_LOCK} 38 | # Now start nfsd 39 | /bin/echo "Starting NFS nfsd..." 40 | eval ${RPC_NFSD} ${USER_OPTS} || exit 1 41 | /bin/touch ${RPC_NFSD_LOCK} 42 | # Now start mountd 43 | /bin/echo "Starting NFS mountd..." 44 | ${RPC_MOUNTD} || exit 1 45 | /bin/touch ${RPC_MOUNTD_LOCK} 46 | # Finally export the NFS file systems (if any exist) 47 | if [ -f "/etc/exports" ]; then 48 | /bin/echo "Exporting all NFS file systems..." 49 | ${EXPORTFS} -ra || : 50 | fi 51 | } 52 | 53 | stop() { 54 | # Now remove / stop everything in reverse 55 | /bin/echo "Removing exported NFS file systems..." 56 | ${EXPORTFS} -au || exit 1 57 | /bin/echo "Stopping NFS statd..." 58 | /usr/bin/kill -TERM $(/usr/bin/pidof ${RPC_STATD}) || exit 1 59 | wait_for_stop ${RPC_STATD} && /bin/rm -f ${RPC_STATD_LOCK} 60 | /bin/echo "Stopping NFS nfsd..." 61 | /usr/bin/killall -HUP nfsd || exit 1 62 | wait_for_stop nfsd && /bin/rm -f ${RPC_NFSD_LOCK} 63 | /bin/echo "Stopping NFS mountd..." 64 | /usr/bin/kill -TERM $(/usr/bin/pidof ${RPC_MOUNTD}) || exit 1 65 | wait_for_stop ${RPC_MOUNTD} && /bin/rm -f ${RPC_MOUNTD_LOCK} 66 | # Remove a PID file that isn't done automatically 67 | if [ -f "/var/run/rpc.statd.pid" ]; then 68 | /bin/echo "Removing the stale rpc.statd PID file..." 69 | /bin/rm -f /var/run/rpc.statd.pid 70 | fi 71 | /bin/echo "Stopping rpcbind..." 72 | /usr/bin/kill -TERM $(/usr/bin/pidof ${RPCBIND}) || exit 1 73 | wait_for_stop ${RPCBIND} && /bin/rm -f ${RPCBIND_LOCK} 74 | } 75 | 76 | status() { 77 | /usr/bin/pidof ${RPCBIND} > /dev/null 2>&1 78 | exit ${?} 79 | } 80 | 81 | # Perform specified action 82 | ${1} 83 | -------------------------------------------------------------------------------- /etc/rc.d/rc.nginx: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | NGINX="/usr/sbin/nginx" 6 | NGINX_LOCK="/var/lock/nginx" 7 | DFLT_OPTS="" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting nginx..." 24 | eval ${NGINX} ${USER_OPTS} || exit 1 25 | /bin/touch ${NGINX_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping nginx..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${NGINX}) || exit 1 31 | wait_for_stop ${NGINX} && /bin/rm -f ${NGINX_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${NGINX} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.nodeexporter: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | NODE_EXPORTER="/usr/bin/node_exporter" 6 | NODE_EXPORTER_LOCK="/var/lock/node_exporter" 7 | DFLT_OPTS="--log.level error > /var/log/node_exporter.log 2>&1 &" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting node_exporter..." 24 | eval ${NODE_EXPORTER} ${USER_OPTS} || exit 1 25 | /bin/touch ${NODE_EXPORTER_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping node_exporter..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${NODE_EXPORTER}) || exit 1 31 | wait_for_stop ${NODE_EXPORTER} && /bin/rm -f ${NODE_EXPORTER_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${NODE_EXPORTER} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.nrpe: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | NRPE="/usr/bin/nrpe" 6 | NRPE_LOCK="/var/lock/nrpe" 7 | DFLT_OPTS="-c /etc/nrpe.cfg -d > /dev/null 2>&1" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting nrpe..." 24 | eval ${NRPE} ${USER_OPTS} || exit 1 25 | /bin/touch ${NRPE_LOCK} 26 | /bin/sleep 1 27 | } 28 | 29 | stop() { 30 | /bin/echo "Stopping nrpe..." 31 | /usr/bin/kill -15 $(/usr/bin/pidof ${NRPE}) || exit 1 32 | wait_for_stop ${NRPE} && /bin/rm -f ${NRPE_LOCK} 33 | } 34 | 35 | status() { 36 | /usr/bin/pidof ${NRPE} > /dev/null 2>&1 37 | exit ${?} 38 | } 39 | 40 | # Perform specified action 41 | ${1} 42 | -------------------------------------------------------------------------------- /etc/rc.d/rc.nut: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | UPSD="/usr/sbin/upsd" 6 | UPSMON="/usr/sbin/upsmon" 7 | UPSDRVCTL="/usr/sbin/upsdrvctl" 8 | UPSD_LOCK="/var/lock/upsd" 9 | UPSMON_LOCK="/var/lock/upsmon" 10 | UPSDRVCTL_LOCK="/var/lock/upsdrvctl" 11 | NUT_USER="nutmon" 12 | 13 | check_args ${@} 14 | 15 | start() { 16 | /bin/echo "Starting NUT UPS drivers..." 17 | ${UPSDRVCTL} -u ${NUT_USER} start || exit 1 18 | /bin/touch ${UPSDRVCTL_LOCK} 19 | /bin/echo "Starting NUT UPS daemon..." 20 | ${UPSD} -u ${NUT_USER} || exit 1 21 | /bin/touch ${UPSD_LOCK} 22 | /bin/echo "Starting NUT UPS monitor..." 23 | ${UPSMON} -u ${NUT_USER} || exit 1 24 | /bin/touch ${UPSMON_LOCK} 25 | } 26 | 27 | stop() { 28 | /bin/echo "Stopping NUT UPS monitor..." 29 | ${UPSMON} -c stop && /bin/rm -f ${UPSMON_LOCK} 30 | /bin/echo "Stopping NUT UPS daemon..." 31 | ${UPSD} -c stop && /bin/rm -f ${UPSD_LOCK} 32 | /bin/echo "Stopping NUT UPS drivers..." 33 | ${UPSDRVCTL} stop && /bin/rm -f ${UPSDRVCTL_LOCK} 34 | } 35 | 36 | status() { 37 | /usr/bin/pidof ${UPSD} > /dev/null 2>&1 38 | exit ${?} 39 | } 40 | 41 | # Perform specified action 42 | ${1} 43 | -------------------------------------------------------------------------------- /etc/rc.d/rc.nvmet: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | NVMETCLI="/usr/sbin/nvmetcli" 6 | NVMET_CONF_FILE="/etc/nvmet/config.json" 7 | 8 | check_args ${@} 9 | 10 | start() { 11 | # Make sure the saved configuration exists 12 | if [ ! -f "${NVMET_CONF_FILE}" ]; then 13 | /bin/echo "NVMe Target: The ${NVMET_CONF_FILE} file is missing!" 14 | exit 1 15 | fi 16 | 17 | # Restore the configuration 18 | /bin/echo "Restoring the NVMe Target configuration..." 19 | ${NVMETCLI} restore ${NVMET_CONF_FILE} || exit 1 20 | } 21 | 22 | stop() { 23 | # We assume the configuration is already saved, so we can clear 24 | # the configuration since we're stopping 25 | /bin/echo "Clearing the NVMe Target configuration..." 26 | ${NVMETCLI} clear || exit 1 27 | } 28 | 29 | status() { 30 | # We don't know anything 31 | exit ${UNKNOWN} 32 | } 33 | 34 | # Perform specified action 35 | ${1} 36 | -------------------------------------------------------------------------------- /etc/rc.d/rc.openibd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | IB_CONFIG="/etc/infiniband/openib.conf" 6 | IB_SYSFS="/sys/class/infiniband" 7 | 8 | check_args ${@} 9 | 10 | # Make sure the IB configuration file exists 11 | if [ ! -f "${IB_CONFIG}" ]; then 12 | /bin/echo "No InfiniBand configuration found!" 13 | exit 0 14 | fi 15 | 16 | # Load configuration 17 | . ${IB_CONFIG} 18 | KERN_MODS="" 19 | if [ "x${MTHCA_LOAD}" == "xyes" ]; then 20 | KERN_MODS="${KERN_MODS} ib_mthca" 21 | fi 22 | if [ "x${MLX4_LOAD}" == "xyes" ]; then 23 | KERN_MODS="${KERN_MODS} mlx4_ib" 24 | fi 25 | if [ "x${MLX5_LOAD}" == "xyes" ]; then 26 | KERN_MODS="${KERN_MODS} mlx5_ib" 27 | fi 28 | if [ "x${QIB_LOAD}" == "xyes" ]; then 29 | KERN_MODS="${KERN_MODS} ib_qib" 30 | fi 31 | if [ "x${CXGB3_LOAD}" == "xyes" ]; then 32 | KERN_MODS="${KERN_MODS} iw_cxgb3" 33 | fi 34 | if [ "x${CXGB4_LOAD}" == "xyes" ]; then 35 | KERN_MODS="${KERN_MODS} iw_cxgb4" 36 | fi 37 | if [ "x${I40IW_LOAD}" == "xyes" ]; then 38 | KERN_MODS="${KERN_MODS} i40iw" 39 | fi 40 | if [ "x${OCRDMA_LOAD}" == "xyes" ]; then 41 | KERN_MODS="${KERN_MODS} ocrdma" 42 | fi 43 | if [ "x${IPOIB_LOAD}" == "xyes" ]; then 44 | KERN_MODS="${KERN_MODS} ib_ipoib" 45 | fi 46 | if [ "x${SRP_LOAD}" == "xyes" ]; then 47 | KERN_MODS="${KERN_MODS} ib_srp" 48 | fi 49 | if [ "x${ISER_LOAD}" == "xyes" ]; then 50 | KERN_MODS="${KERN_MODS} ib_iser" 51 | fi 52 | if [ "x${RDMA_UCM_LOAD}" == "xyes" ]; then 53 | KERN_MODS="${KERN_MODS} rdma_ucm" 54 | fi 55 | 56 | start() { 57 | # Load the modules 58 | /bin/echo "Loading configured IB modules..." 59 | for i in ${KERN_MODS}; do 60 | /sbin/modprobe ${i} || exit 1 61 | done 62 | /sbin/modprobe ib_umad || exit 1 63 | /sbin/modprobe ib_uverbs || exit 1 64 | /sbin/modprobe rdmavt || exit 1 65 | # Add node description to sysfs 66 | if [ -d ${IB_SYSFS} ]; then 67 | hca_id=1 68 | for hca in ${IB_SYSFS}/*; do 69 | if [ -e ${hca}/node_desc ]; then 70 | /usr/bin/logger "Set node_desc for $(/usr/bin/basename $hca): $(/bin/hostname -s) HCA-${hca_id}" 71 | echo -n "$(/bin/hostname -s) HCA-${hca_id}" >> ${hca}/node_desc 72 | fi 73 | hca_id=$(/usr/bin/expr ${hca_id} + 1) 74 | done 75 | fi 76 | # Enable connected mode for IPoIB interfaces 77 | if [ "x${IPOIB_LOAD}" == "xyes" ]; then 78 | interfaces=$(cd /sys/class/net; /bin/ls -d ib* 2> /dev/null) 79 | for i in ${interfaces}; do 80 | if [ "x${SET_IPOIB_CM}" == "xyes" ]; then 81 | if [ ! -e /sys/class/net/${i}/mode ]; then 82 | /bin/echo "Failed to configure IPoIB connected mode for ${i}." 83 | fi 84 | /bin/sleep 1 85 | /bin/echo connected > /sys/class/net/${i}/mode 86 | fi 87 | done 88 | fi 89 | # A delay here is required for some HCA's 90 | /bin/echo "Waiting for any physical links to establish..." 91 | /bin/sleep 10 92 | } 93 | 94 | stop() { 95 | # Unload the modules 96 | /bin/echo "Unloading configured IB modules..." 97 | for i in $(/bin/echo ${KERN_MODS} | /usr/bin/tr ' ' '\n' | \ 98 | /usr/bin/tac | /usr/bin/tr '\n' ' '); do 99 | /sbin/rmmod -w ${i} 100 | done 101 | /sbin/rmmod -w rdmavt 102 | /sbin/rmmod -w ib_uverbs 103 | /sbin/rmmod -w ib_umad 104 | } 105 | 106 | status() { 107 | # We don't know anything 108 | exit ${UNKNOWN} 109 | } 110 | 111 | # Perform specified action 112 | ${1} 113 | -------------------------------------------------------------------------------- /etc/rc.d/rc.opensm: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | OPENSM="/usr/sbin/opensm" 6 | OPENSM_LOCK="/var/lock/opensm" 7 | DFLT_OPTS="--daemon > /dev/null 2>&1" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting IB Subnet Manager..." 24 | eval ${OPENSM} ${USER_OPTS} || exit 1 25 | /bin/touch ${OPENSM_LOCK} 26 | /bin/sleep 1 27 | } 28 | 29 | stop() { 30 | /bin/echo "Stopping IB Subnet Manager..." 31 | /usr/bin/kill -15 $(/usr/bin/pidof ${OPENSM}) || exit 1 32 | wait_for_stop ${OPENSM} && /bin/rm -f ${OPENSM_LOCK} 33 | } 34 | 35 | status() { 36 | /usr/bin/pidof ${OPENSM} > /dev/null 2>&1 37 | exit ${?} 38 | } 39 | 40 | # Perform specified action 41 | ${1} 42 | -------------------------------------------------------------------------------- /etc/rc.d/rc.pacemaker: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | PACEMAKERD="/usr/sbin/pacemakerd" 6 | PACEMAKERD_LOCK="/var/lock/pacemakerd" 7 | DFLT_OPTS="> /dev/null 2>&1" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | if check_enabled "rc.corosync"; then 24 | if ! /etc/rc.d/rc.corosync status; then 25 | /bin/echo "Corosync is not running, skipping Pacemaker start!" 26 | exit 1 27 | fi 28 | fi 29 | /bin/echo "Starting pacemakerd..." 30 | /bin/sh -c "/usr/bin/nohup ${PACEMAKERD} ${USER_OPTS} &" 31 | /bin/touch ${PACEMAKERD_LOCK} 32 | /bin/sleep 1 33 | } 34 | 35 | stop() { 36 | /bin/echo "Stopping pacemakerd..." 37 | /usr/bin/kill -TERM $(/usr/bin/pidof ${PACEMAKERD}) || exit 1 38 | if wait_for_stop ${PACEMAKERD}; then 39 | /bin/rm -f ${PACEMAKERD_LOCK} 40 | else 41 | # If Pacemaker fails to stop, prompt to login so we can investigate 42 | /bin/echo "ERROR: The cluster resource manager failed to stop!" 43 | if /sbin/runlevel | /usr/bin/cut -d' ' -f2 | /bin/grep -q -E '0|6'; then 44 | /usr/sbin/sulogin --force /dev/console 45 | fi 46 | fi 47 | } 48 | 49 | status() { 50 | /usr/bin/pidof ${PACEMAKERD} > /dev/null 2>&1 51 | exit ${?} 52 | } 53 | 54 | # Perform specified action 55 | ${1} 56 | -------------------------------------------------------------------------------- /etc/rc.d/rc.prometheus: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | PROMETHEUS="/usr/bin/prometheus" 6 | PROMETHEUS_LOCK="/var/lock/prometheus" 7 | DFLT_OPTS="--config.file /etc/prometheus/prometheus.yml --log.level error > /var/log/prometheus.log 2>&1 &" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting prometheus..." 24 | eval ${PROMETHEUS} ${USER_OPTS} || exit 1 25 | /bin/touch ${PROMETHEUS_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping prometheus..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${PROMETHEUS}) || exit 1 31 | wait_for_stop ${PROMETHEUS} && /bin/rm -f ${PROMETHEUS_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${PROMETHEUS} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.rasdaemon: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | RASDAEMON="/usr/sbin/rasdaemon" 6 | RASDAEMON_LOCK="/var/lock/rasdaemon" 7 | DFLT_OPTS="-r" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting rasdaemon..." 24 | eval ${RASDAEMON} ${USER_OPTS} || exit 1 25 | /bin/touch ${RASDAEMON_LOCK} 26 | /bin/sleep 1 27 | } 28 | 29 | stop() { 30 | /bin/echo "Stopping rasdaemon..." 31 | /usr/bin/kill -TERM $(/usr/bin/pidof ${RASDAEMON}) || exit 1 32 | wait_for_stop ${RASDAEMON} && /bin/rm -f ${RASDAEMON_LOCK} 33 | } 34 | 35 | status() { 36 | /usr/bin/pidof ${RASDAEMON} > /dev/null 2>&1 37 | exit ${?} 38 | } 39 | 40 | # Perform specified action 41 | ${1} 42 | -------------------------------------------------------------------------------- /etc/rc.d/rc.rbdmap: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | SYSFS_RBD="/sys/bus/rbd" 6 | RBDMAP_FILE="/etc/ceph/rbdmap" 7 | CEPHCONF_FILE="/etc/ceph/ceph.conf" 8 | 9 | check_args ${@} 10 | 11 | start() { 12 | # Make sure the map file exists 13 | if [ ! -f "${RBDMAP_FILE}" ]; then 14 | /bin/echo "RBD Mapping: The ${RBDMAP_FILE} file is missing!" 15 | exit 1 16 | fi 17 | 18 | # Read the file and creating mapping(s) 19 | /bin/echo "Mapping all Ceph RBD images..." 20 | while read dev params; do 21 | case "${dev}" in 22 | ""|\#*) 23 | continue 24 | ;; 25 | */*) 26 | ;; 27 | *) 28 | dev=rbd/${dev} 29 | ;; 30 | esac 31 | 32 | if [ ! -b /dev/rbd/${dev} ]; then 33 | mons=$(/bin/egrep 'mon[ _]host' ${CEPHCONF_FILE} | \ 34 | /usr/bin/cut -f2 -d'=' | /usr/bin/sed 's/ //g') 35 | name=$(/bin/echo ${params} | /bin/grep -o id=.*, | \ 36 | /usr/bin/cut -d',' -f1 | /usr/bin/cut -d'=' -f2 | \ 37 | /usr/bin/sed 's/id=/name=/g') 38 | keyring=$(/bin/echo ${params} | /bin/grep -o keyring.* | \ 39 | /usr/bin/cut -d'=' -f2) 40 | secret=$(/bin/grep 'key =' ${keyring} | /usr/bin/cut -d' ' -f3) 41 | rbddev=$(/bin/echo ${dev} | /usr/bin/tr '/' ' ') 42 | /bin/echo "${mons} name=${name},secret=${secret} ${rbddev}" > \ 43 | ${SYSFS_RBD}/add 44 | fi 45 | done < ${RBDMAP_FILE} 46 | } 47 | 48 | stop() { 49 | /bin/echo "Unmapping all Ceph RBD images..." 50 | cd ${SYSFS_RBD}/devices/ 51 | if /bin/ls * > /dev/null 2>&1; then 52 | for dev in *; do 53 | /bin/echo ${dev} > ${SYSFS_RBD}/remove 54 | done 55 | fi 56 | } 57 | 58 | status() { 59 | # We don't know anything 60 | exit ${UNKNOWN} 61 | } 62 | 63 | # Perform specified action 64 | ${1} 65 | -------------------------------------------------------------------------------- /etc/rc.d/rc.sbd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | SBD_CONFIG="/etc/sysconfig/sbd" 6 | SBD="/usr/sbin/sbd" 7 | SBD_PID_FILE="/var/run/sbd.pid" 8 | SBD_LOCK="/var/lock/sbd" 9 | SBD_STARTS_DIR="/etc/esos_sbd/starts" 10 | SBD_STARTS_SEC="1800" 11 | SBD_MAX_STARTS="3" 12 | RC_SBD_LOGGER="/usr/bin/logger -t rc.sbd -p daemon.info" 13 | 14 | check_args ${@} 15 | 16 | # Make sure the SBD configuration file exists 17 | if [ ! -f "${SBD_CONFIG}" ]; then 18 | /bin/echo "No SBD configuration found!" 19 | exit 0 20 | fi 21 | 22 | # Load configuration (and export all variables) 23 | set -a 24 | . ${SBD_CONFIG} 25 | set +a 26 | 27 | start() { 28 | /bin/echo "Starting sbd..." 29 | /bin/mkdir -p "${SBD_STARTS_DIR}" 30 | /bin/touch "${SBD_STARTS_DIR}/$(/bin/date +%s)" 31 | /usr/local/sbin/conf_sync.sh 32 | curr_time="$(/bin/date +%s)" 33 | time_thresh="$(("${curr_time}" - "${SBD_STARTS_SEC}"))" 34 | start_cnt="0" 35 | while read -r start_file; do 36 | start_time="$(/usr/bin/basename "${start_file}")" 37 | if [ "${start_time}" -gt "${time_thresh}" ]; then 38 | start_cnt="$(("${start_cnt}" + "1"))" 39 | fi 40 | done <<< "$(/usr/bin/find "${SBD_STARTS_DIR}" -type f)" 41 | if [ "${start_cnt}" -gt "${SBD_MAX_STARTS}" ]; then 42 | ${RC_SBD_LOGGER} "More than ${SBD_MAX_STARTS} SBD starts in the" \ 43 | "last ${SBD_STARTS_SEC} seconds have been detected!" 44 | ${RC_SBD_LOGGER} "Configuration file 'SBD_STARTMODE'" \ 45 | "value: ${SBD_STARTMODE}" 46 | else 47 | if [ "x${SBD_STARTMODE}" = "xclean" ]; then 48 | ${RC_SBD_LOGGER} "SBD start threshold has not been exceeded;" \ 49 | "overriding 'SBD_STARTMODE' value of 'clean' to 'always'." 50 | export SBD_STARTMODE="always" 51 | fi 52 | fi 53 | /bin/sh -c "/usr/bin/nohup ${SBD} ${SBD_OPTS} \ 54 | -p ${SBD_PID_FILE} watch > /dev/null 2>&1 &" 55 | /bin/sleep 1 56 | if [ ! -e "${SBD_PID_FILE}" ]; then 57 | /bin/echo "SBD failed to start! Check the logs for more information." 58 | exit 1 59 | fi 60 | /bin/touch ${SBD_LOCK} 61 | } 62 | 63 | stop() { 64 | /bin/echo "Stopping sbd..." 65 | /usr/bin/kill -TERM $(/usr/bin/pidof ${SBD}) || exit 1 66 | wait_for_stop ${SBD} && /bin/rm -f ${SBD_LOCK} 67 | } 68 | 69 | status() { 70 | /usr/bin/pidof ${SBD} > /dev/null 2>&1 71 | exit ${?} 72 | } 73 | 74 | # Perform specified action 75 | ${1} 76 | -------------------------------------------------------------------------------- /etc/rc.d/rc.scst: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | SCST_MODS="scst iscsi_scst isert_scst ib_srpt \ 6 | scst_disk scst_vdisk scst_tape scst_changer fcst" 7 | SCST_CFG="/etc/scst.conf" 8 | SCSTADMIN="/usr/sbin/scstadmin" 9 | ISCSI_SCSTD="/usr/sbin/iscsi-scstd" 10 | ISCSI_SCSTD_LOCK="/var/lock/iscsi-scstd" 11 | FCOEMON="/usr/sbin/fcoemon" 12 | FCOEMON_LOCK="/var/lock/fcoemon" 13 | LLDPAD_PID="/var/run/lldpad.pid" 14 | 15 | # Which Cavium/QLogic target module 16 | if [ -f "/lib/modules/$(/bin/uname -r)/extra/qla2x00tgt.ko" ]; then 17 | SCST_MODS="${SCST_MODS} qla2x00tgt" 18 | else 19 | SCST_MODS="${SCST_MODS} scst_qla2xxx" 20 | fi 21 | 22 | # For optional SCST modules 23 | OPTL_MODS="" 24 | if [ -f "/lib/modules/$(/bin/uname -r)/extra/atto_scst.ko" ]; then 25 | OPTL_MODS="${OPTL_MODS} atto_scst" 26 | fi 27 | if [ -f "/lib/modules/$(/bin/uname -r)/extra/ocs_fc_scst.ko" ]; then 28 | OPTL_MODS="${OPTL_MODS} ocs_fc_scst" 29 | fi 30 | if [ -f "/lib/modules/$(/bin/uname -r)/extra/chfcoe.ko" ]; then 31 | OPTL_MODS="${OPTL_MODS} chfcoe" 32 | fi 33 | 34 | check_args ${@} 35 | 36 | load_kern_mods() { 37 | /bin/echo "Loading SCST kernel modules..." 38 | # Load the core SCST modules first 39 | for i in ${SCST_MODS}; do 40 | /sbin/modprobe ${i} || return 1 41 | done 42 | # Load the optional driver modules next (don't check exit status) 43 | for i in ${OPTL_MODS}; do 44 | /sbin/modprobe -s ${i} 45 | done 46 | return 0 47 | } 48 | 49 | unload_kern_mods() { 50 | /bin/echo "Unloading SCST kernel modules..." 51 | # Unload the optional driver modules first (don't check exit status) 52 | for i in $(/bin/echo ${OPTL_MODS} | /usr/bin/tr ' ' '\n' | \ 53 | /usr/bin/tac | /usr/bin/tr '\n' ' '); do 54 | if [ -d /sys/module/${i} ]; then 55 | /sbin/rmmod -w ${i} 56 | fi 57 | done 58 | # Unload the core SCST modules next 59 | for i in $(/bin/echo ${SCST_MODS} | /usr/bin/tr ' ' '\n' | \ 60 | /usr/bin/tac | /usr/bin/tr '\n' ' '); do 61 | /sbin/rmmod -w ${i} || return 1 62 | done 63 | return 0 64 | } 65 | 66 | start_user_progs() { 67 | /bin/echo "Starting SCST userland daemons..." 68 | ${ISCSI_SCSTD} || return 1 69 | /bin/touch ${ISCSI_SCSTD_LOCK} 70 | if [ -e "${LLDPAD_PID}" ]; then 71 | ${FCOEMON} -s || return 1 72 | /bin/touch ${FCOEMON_LOCK} 73 | fi 74 | return 0 75 | } 76 | 77 | stop_user_progs() { 78 | /bin/echo "Stopping SCST userland daemons..." 79 | if [ -e "${LLDPAD_PID}" ]; then 80 | /usr/bin/kill -TERM $(/usr/bin/pidof ${FCOEMON}) || return 1 81 | wait_for_stop ${FCOEMON} && /bin/rm -f ${FCOEMON_LOCK} 82 | fi 83 | /usr/bin/kill -TERM $(/usr/bin/pidof ${ISCSI_SCSTD}) || return 1 84 | wait_for_stop ${ISCSI_SCSTD} && /bin/rm -f ${ISCSI_SCSTD_LOCK} 85 | /bin/sleep 1 86 | return 0 87 | } 88 | 89 | apply_config() { 90 | if [ -f ${SCST_CFG} ]; then 91 | /bin/echo "Applying SCST configuration..." 92 | /usr/sbin/scstadmin -config ${SCST_CFG} -lip || return 1 93 | fi 94 | return 0 95 | } 96 | 97 | start() { 98 | # If our pre-SCST file exists, run it 99 | if [ -f /etc/pre-scst_xtra_conf ]; then 100 | /bin/echo "Pre-SCST user config. file found; running..." 101 | /bin/sh /etc/pre-scst_xtra_conf 102 | fi 103 | # Load the SCST core modules and target drivers 104 | load_kern_mods || exit 1 105 | # Start the iSCSI SCST daemon and daemons required for FCST 106 | start_user_progs || exit 1 107 | # Configure SCST (if it fails, stop SCST) 108 | apply_config || (stop_user_progs; unload_kern_mods; exit 1) 109 | # If our post-SCST file exists, run it 110 | if [ -f /etc/post-scst_xtra_conf ]; then 111 | /bin/echo "Post-SCST user config. file found; running..." 112 | /bin/sh /etc/post-scst_xtra_conf 113 | fi 114 | } 115 | 116 | stop() { 117 | # Stop all of the userland daemons 118 | stop_user_progs || exit 1 119 | # Unload all of the modules in reverse order 120 | unload_kern_mods || exit 1 121 | } 122 | 123 | status() { 124 | if [ -d "/sys/kernel/scst_tgt" ]; then 125 | exit ${RUNNING} 126 | else 127 | exit ${STOPPED} 128 | fi 129 | } 130 | 131 | # Perform specified action 132 | ${1} 133 | -------------------------------------------------------------------------------- /etc/rc.d/rc.serial: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | INITTAB="/etc/inittab" 6 | SETSERIAL="/bin/setserial" 7 | 8 | check_args ${@} 9 | 10 | start() { 11 | local ports update 12 | ports=$(${SETSERIAL} -g /dev/ttyS[0123] | /bin/grep -vi unknown | \ 13 | /usr/bin/sed -e 's/,.*//' | /usr/bin/sed -e 's@/dev/ttyS@@') 14 | if [ -n "${ports}" ]; then 15 | # Remove any current serial port entries for our ports 16 | grep -v "ttyS[$ports]" ${INITTAB} > ${INITTAB}.new 17 | mv ${INITTAB}.new ${INITTAB} 18 | fi 19 | for f in ${ports}; do 20 | /bin/grep "^s${f}" ${INITTAB} > /dev/null 21 | if [ $? -ne 0 ]; then 22 | /bin/echo "Adding serial port '${f}' to inittab..." 23 | /bin/echo "s${f}:2345:respawn:/sbin/agetty -L ttyS${f} 115200 vt100" \ 24 | >> ${INITTAB} 25 | fi 26 | done 27 | /usr/local/sbin/conf_sync.sh 28 | /sbin/init q 29 | } 30 | 31 | stop() { 32 | # Do nothing 33 | : 34 | } 35 | 36 | status() { 37 | # We don't know anything 38 | exit ${UNKNOWN} 39 | } 40 | 41 | # Perform specified action 42 | ${1} 43 | -------------------------------------------------------------------------------- /etc/rc.d/rc.smartd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | SMARTD="/usr/sbin/smartd" 6 | SMARTD_LOCK="/var/lock/smartd" 7 | DFLT_OPTS="-q never > /dev/null 2>&1" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting smartd..." 24 | eval ${SMARTD} ${USER_OPTS} || exit 1 25 | /bin/touch ${SMARTD_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping smartd..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${SMARTD}) || exit 1 31 | wait_for_stop ${SMARTD} && /bin/rm -f ${SMARTD_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${SMARTD} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.snmpd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | SNMPD="/usr/sbin/snmpd" 6 | SNMPD_LOCK="/var/lock/snmpd" 7 | DFLT_OPTS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid > /dev/null 2>&1" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting snmpd..." 24 | eval ${SNMPD} ${USER_OPTS} || exit 1 25 | /bin/touch ${SNMPD_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping snmpd..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${SNMPD}) || exit 1 31 | wait_for_stop ${SNMPD} && /bin/rm -f ${SNMPD_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${SNMPD} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.snmptrapd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | SNMPTRAPD="/usr/sbin/snmptrapd" 6 | SNMPTRAPD_LOCK="/var/lock/snmptrapd" 7 | DFLT_OPTS="-Lsd -p /var/run/snmptrapd.pid > /dev/null 2>&1" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting snmptrapd..." 24 | eval ${SNMPTRAPD} ${USER_OPTS} || exit 1 25 | /bin/touch ${SNMPTRAPD_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping snmptrapd..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${SNMPTRAPD}) || exit 1 31 | wait_for_stop ${SNMPTRAPD} && /bin/rm -f ${SNMPTRAPD_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${SNMPTRAPD} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.sshd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | SSHD="/usr/sbin/sshd" 6 | SSHD_LOCK="/var/lock/sshd" 7 | DFLT_OPTS="-f /etc/ssh/sshd_config" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | # Generate keys if necessary 24 | for i in ecdsa ed25519 rsa; do 25 | key_file="/etc/ssh/ssh_host_${i}_key" 26 | if [ ! -e "${key_file}" ]; then 27 | /bin/echo "Creating a '${i}' SSH host key..." 28 | /usr/bin/ssh-keygen -t ${i} -f "${key_file}" -N '' 29 | fi 30 | done 31 | # Start sshd 32 | /bin/echo "Starting sshd..." 33 | eval ${SSHD} ${USER_OPTS} || exit 1 34 | /bin/touch ${SSHD_LOCK} 35 | } 36 | 37 | stop() { 38 | /bin/echo "Stopping sshd..." 39 | /usr/bin/kill -TERM $(/usr/bin/pidof ${SSHD}) || exit 1 40 | wait_for_stop ${SSHD} && /bin/rm -f ${SSHD_LOCK} 41 | } 42 | 43 | status() { 44 | /usr/bin/pidof ${SSHD} > /dev/null 2>&1 45 | exit ${?} 46 | } 47 | 48 | # Perform specified action 49 | ${1} 50 | -------------------------------------------------------------------------------- /etc/rc.d/rc.stunnel: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | STUNNEL="/usr/bin/stunnel" 6 | STUNNEL_LOCK="/var/lock/stunnel" 7 | DFLT_OPTS="" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting stunnel..." 24 | eval ${STUNNEL} ${USER_OPTS} || exit 1 25 | /bin/touch ${STUNNEL_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping stunnel..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${STUNNEL}) || exit 1 31 | wait_for_stop ${STUNNEL} && /bin/rm -f ${STUNNEL_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${STUNNEL} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.sysinit: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | /bin/echo "Mounting special file systems..." 4 | /bin/mount /dev 5 | /bin/mount /proc 6 | /bin/mount /sys 7 | /bin/mkdir /dev/pts 8 | /bin/mount /dev/pts 9 | /bin/mkdir /dev/shm 10 | /bin/mount /dev/shm 11 | /bin/mount -t configfs none /sys/kernel/config 12 | /bin/mount -t debugfs nodev /sys/kernel/debug 13 | /bin/mount -t tmpfs tmpfs /sys/fs/cgroup 14 | for i in cpuset cpu cpuacct blkio memory devices freezer perf_event pids; do 15 | /bin/mkdir -p /sys/fs/cgroup/${i} 16 | /bin/mount -t cgroup -o ${i} none /sys/fs/cgroup/${i} 17 | done 18 | /bin/echo 1 > /sys/fs/cgroup/memory/memory.use_hierarchy 19 | 20 | /bin/ln -sf bash /bin/sh 21 | /bin/grep -v rootfs /proc/mounts > /etc/mtab 22 | 23 | if /bin/grep esos_persist /proc/cmdline > /dev/null 2>&1; then 24 | /bin/echo "Persistent mode enabled; checking and mounting file systems..." 25 | ESOS_PERSIST=1 /etc/rc.d/rc.fsmount start 26 | if /bin/mountpoint -q /mnt/logs; then 27 | /bin/mkdir -p /mnt/logs/var_log 28 | /bin/mount --bind /mnt/logs/var_log /var/log 29 | else 30 | /bin/echo "ERROR: It appears 'esos_logs' is not mounted!" 31 | fi 32 | fi 33 | 34 | # Set a temporary host name 35 | /bin/hostname localhost 36 | 37 | # Start logging daemons early 38 | /sbin/bootlogd -c 39 | /usr/sbin/syslogd 40 | 41 | if ! /bin/grep esos_iso /proc/cmdline > /dev/null 2>&1; then 42 | /bin/echo "Performing initial configuration sync..." 43 | /bin/touch /etc/esos-release 44 | /usr/local/sbin/usb_sync.sh --initial 45 | fi 46 | 47 | if [ -x /etc/rc.d/rc.udev ]; then 48 | /etc/rc.d/rc.udev 49 | fi 50 | 51 | /bin/touch /var/log/wtmp 52 | /bin/touch /var/log/lastlog 53 | 54 | if [ ! -L "/etc/localtime" ]; then 55 | /bin/ln -s /usr/share/zoneinfo/posix/Factory /etc/localtime 56 | fi 57 | 58 | if /bin/grep single_user /proc/cmdline > /dev/null 2>&1; then 59 | if [ -e "/etc/single_user_needs_password" ]; then 60 | /usr/sbin/sulogin --force /dev/console 61 | else 62 | /bin/bash -i 63 | fi 64 | fi 65 | 66 | /bin/echo "Starting kernel log daemon (klogd)..." 67 | /usr/sbin/klogd -c1 68 | 69 | /bin/echo "Configuring kernel parameters..." 70 | /usr/sbin/sysctl -p /etc/sysctl.conf 71 | 72 | /bin/echo "Setting the x86 energy MSR policy for maximum performance..." 73 | /usr/bin/x86_energy_perf_policy performance 74 | 75 | /bin/echo "Disabling the C2 CPU idle state..." 76 | /usr/bin/cpupower idle-set -d 2 > /dev/null 77 | 78 | /bin/echo "Setting the CPU governor to 'performance'..." 79 | /usr/bin/cpupower frequency-set -g performance > /dev/null 80 | 81 | if [ -f "/var/lib/esos/random-seed" ]; then 82 | /bin/echo "Initializing random number generator..." 83 | /bin/cat /var/lib/esos/random-seed > /dev/urandom 84 | /bin/rm -f /var/lib/esos/random-seed 85 | fi 86 | 87 | /bin/echo "Setting system time from hardware clock..." 88 | /sbin/hwclock --hctosys --utc 89 | 90 | /bin/echo "Updating module dependencies..." 91 | /sbin/depmod -a 92 | 93 | /bin/echo "Updating run-time linker cache..." 94 | /sbin/ldconfig 95 | 96 | if ! /bin/grep -E 'esos_iso|esos_persist' /proc/cmdline > /dev/null 2>&1; then 97 | fs_node=$(/sbin/findfs LABEL=esos_logs) 98 | base_blk_dev="$(/bin/echo ${fs_node} | \ 99 | /usr/bin/sed -e '/\/dev\/sd/s/4//; /\/dev\/nvme/s/p4//')" 100 | if [ -n "${fs_node}" ]; then 101 | free_end=$(/usr/sbin/parted -m -s ${base_blk_dev} unit s print free | \ 102 | egrep ':free;$' | tail -n+2 | cut -d: -f3) 103 | if [ -n "${free_end}" ]; then 104 | echo "Growing the esos_logs file system..." 105 | orig_start=`/usr/sbin/parted -m -s ${base_blk_dev} unit s print | \ 106 | egrep '^4:' | cut -d: -f2` 107 | /usr/sbin/parted -m -s ${base_blk_dev} rm 4 108 | /usr/sbin/parted -m -s ${base_blk_dev} mkpart primary \ 109 | ${orig_start} ${free_end} 110 | /usr/sbin/udevadm settle --timeout=30 111 | /sbin/blockdev --rereadpt ${base_blk_dev} 112 | /bin/sleep 1 113 | /usr/sbin/e2fsck -pf ${fs_node} 114 | /usr/sbin/resize2fs -p ${fs_node} 115 | fi 116 | fi 117 | fi 118 | -------------------------------------------------------------------------------- /etc/rc.d/rc.syslogd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | SYSLOGD="/usr/sbin/syslogd" 6 | SYSLOGD_LOCK="/var/lock/syslogd" 7 | DFLT_OPTS="" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting system log daemon (syslogd)..." 24 | eval ${SYSLOGD} ${USER_OPTS} || exit 1 25 | /bin/touch ${SYSLOGD_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping system log daemon (syslogd)..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${SYSLOGD}) || exit 1 31 | wait_for_stop ${SYSLOGD} && /bin/rm -f ${SYSLOGD_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${SYSLOGD} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.telegraf: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | TELEGRAF="/usr/bin/telegraf" 6 | TELEGRAF_LOCK="/var/lock/telegraf" 7 | DFLT_OPTS="> /var/log/telegraf.log 2>&1 &" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting telegraf..." 24 | eval ${TELEGRAF} ${USER_OPTS} || exit 1 25 | /bin/touch ${TELEGRAF_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping telegraf..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${TELEGRAF}) || exit 1 31 | wait_for_stop ${TELEGRAF} && /bin/rm -f ${TELEGRAF_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${TELEGRAF} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.udev: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | UDEV_CONF="/etc/udev/udev.conf" 4 | UDEVD="/usr/sbin/udevd" 5 | UDEVADM="/usr/sbin/udevadm" 6 | 7 | # Load the udev configuration file 8 | if [ -e "${UDEV_CONF}" ]; then 9 | source ${UDEV_CONF} 10 | fi 11 | 12 | if [ ! -f "/etc/udev/hwdb.bin" ]; then 13 | /bin/echo "Generating the udev hardware database index..." 14 | ${UDEVADM} hwdb --update 15 | fi 16 | 17 | # Start the udev daemon and populate /dev 18 | /bin/echo "Starting udevd..." 19 | ${UDEVD} --daemon 20 | /bin/echo "Populating /dev with existing devices..." 21 | ${UDEVADM} trigger --type=subsystems --action=add 22 | ${UDEVADM} trigger --type=devices --action=add 23 | #${UDEVADM} control --property=STARTUP=1 24 | /bin/echo "Waiting for uevents to be processed..." 25 | ${UDEVADM} settle --timeout=${udev_settle_timeout:-60} 26 | #${UDEVADM} control --property=STARTUP= 27 | 28 | -------------------------------------------------------------------------------- /etc/rc.d/rc.virtlogd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | VIRTLOGD="/usr/sbin/virtlogd" 6 | VIRTLOGD_LOCK="/var/lock/virtlogd" 7 | DFLT_OPTS="-d" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting virtlogd..." 24 | eval ${VIRTLOGD} ${USER_OPTS} || exit 1 25 | /bin/touch ${VIRTLOGD_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping virtlogd..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${VIRTLOGD}) || exit 1 31 | wait_for_stop ${VIRTLOGD} && /bin/rm -f ${VIRTLOGD_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${VIRTLOGD} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.vmtoolsd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | VMTOOLSD="/usr/bin/vmtoolsd" 6 | VMTOOLSD_LOCK="/var/lock/vmtoolsd" 7 | DFLT_OPTS="-b /var/run/vmtoolsd.pid" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting VMware Tools..." 24 | eval ${VMTOOLSD} ${USER_OPTS} || exit 1 25 | /bin/touch ${VMTOOLSD_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping VMware Tools..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${VMTOOLSD}) || exit 1 31 | wait_for_stop ${VMTOOLSD} && /bin/rm -f ${VMTOOLSD_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${VMTOOLSD} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.watchdog: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | WATCHDOG="/sbin/watchdog" 6 | WATCHDOG_LOCK="/var/lock/watchdog" 7 | DFLT_OPTS="-T 90 /dev/watchdog" 8 | 9 | check_args ${@} 10 | 11 | SCRIPT="$(/usr/bin/basename ${0})" 12 | if check_opts_set ${SCRIPT}; then 13 | USER_OPTS="$(get_rc_opts ${SCRIPT})" 14 | if [ ${?} -ne 0 ]; then 15 | /bin/echo ${USER_OPTS} 16 | exit 1 17 | fi 18 | else 19 | USER_OPTS="${DFLT_OPTS}" 20 | fi 21 | 22 | start() { 23 | /bin/echo "Starting watchdog..." 24 | eval ${WATCHDOG} ${USER_OPTS} || exit 1 25 | /bin/touch ${WATCHDOG_LOCK} 26 | } 27 | 28 | stop() { 29 | /bin/echo "Stopping watchdog..." 30 | /usr/bin/kill -TERM $(/usr/bin/pidof ${WATCHDOG}) || exit 1 31 | wait_for_stop ${WATCHDOG} && /bin/rm -f ${WATCHDOG_LOCK} 32 | } 33 | 34 | status() { 35 | /usr/bin/pidof ${WATCHDOG} > /dev/null 2>&1 36 | exit ${?} 37 | } 38 | 39 | # Perform specified action 40 | ${1} 41 | -------------------------------------------------------------------------------- /etc/rc.d/rc.zfs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | source /etc/rc.d/common 4 | 5 | ZPOOL="/usr/sbin/zpool" 6 | ZPOOL_CACHE="/etc/zfs/zpool.cache" 7 | 8 | check_args ${@} 9 | 10 | if [ -f "/lib/modules/$(/bin/uname -r)/extra/zfs/zfs.ko" ]; then 11 | # Make sure the ZFS module is loaded, otherwise nothing to do 12 | if [ ! -d "/proc/spl/kstat/zfs" ]; then 13 | /bin/echo "It appears the ZFS module isn't loaded!" 14 | exit 1 15 | fi 16 | else 17 | # Exit silently if the ZFS module isn't installed 18 | exit 0 19 | fi 20 | 21 | start() { 22 | # Import all ZFS pools 23 | /bin/echo "Importing ZFS pools..." 24 | if [ -f "${ZPOOL_CACHE}" ]; then 25 | ${ZPOOL} import -c ${ZPOOL_CACHE} -aN 26 | fi 27 | ${ZPOOL} import -d /dev/disk/by-id -aN 28 | } 29 | 30 | stop() { 31 | # Do nothing 32 | : 33 | } 34 | 35 | status() { 36 | # We don't know anything 37 | exit ${UNKNOWN} 38 | } 39 | 40 | # Perform specified action 41 | ${1} 42 | -------------------------------------------------------------------------------- /etc/rc.local: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Send a system startup email 4 | /usr/local/sbin/startup.sh > /dev/null 2>&1 & 5 | 6 | -------------------------------------------------------------------------------- /etc/send_nsca.cfg: -------------------------------------------------------------------------------- 1 | #################################################### 2 | # Sample NSCA Client Config File 3 | # Written by: Ethan Galstad (nagios@nagios.org) 4 | # 5 | # Last Modified: 02-21-2002 6 | #################################################### 7 | 8 | 9 | # ENCRYPTION PASSWORD 10 | # This is the password/passphrase that should be used to encrypt the 11 | # outgoing packets. Note that the nsca daemon must use the same 12 | # password when decrypting the packet! 13 | # IMPORTANT: You don't want all the users on this system to be able 14 | # to read the password you specify here, so make sure to set 15 | # restrictive permissions on this config file! 16 | 17 | #password= 18 | 19 | 20 | 21 | # ENCRYPTION METHOD 22 | # This option determines the method by which the send_nsca client will 23 | # encrypt the packets it sends to the nsca daemon. The encryption 24 | # method you choose will be a balance between security and performance, 25 | # as strong encryption methods consume more processor resources. 26 | # You should evaluate your security needs when choosing an encryption 27 | # method. 28 | # 29 | # Note: The encryption method you specify here must match the 30 | # decryption method the nsca daemon uses (as specified in 31 | # the nsca.cfg file)!! 32 | # Values: 33 | # 0 = None (Do NOT use this option) 34 | # 1 = Simple XOR (No security, just obfuscation, but very fast) 35 | # 36 | # 2 = DES 37 | # 3 = 3DES (Triple DES) 38 | # 4 = CAST-128 39 | # 5 = CAST-256 40 | # 6 = xTEA 41 | # 7 = 3WAY 42 | # 8 = BLOWFISH 43 | # 9 = TWOFISH 44 | # 10 = LOKI97 45 | # 11 = RC2 46 | # 12 = ARCFOUR 47 | # 48 | # 14 = RIJNDAEL-128 49 | # 15 = RIJNDAEL-192 50 | # 16 = RIJNDAEL-256 51 | # 52 | # 19 = WAKE 53 | # 20 = SERPENT 54 | # 55 | # 22 = ENIGMA (Unix crypt) 56 | # 23 = GOST 57 | # 24 = SAFER64 58 | # 25 = SAFER128 59 | # 26 = SAFER+ 60 | # 61 | 62 | encryption_method=1 63 | 64 | -------------------------------------------------------------------------------- /etc/shadow: -------------------------------------------------------------------------------- 1 | root:$6$1v.9KwWR$yEo3iovmlgNcPhDGrqE8e5/SHzWMJ0e7SC/DoF8K/d0wKTWPoSv.hIImPIi95mTsfm07ED6MJoV8c0p.UvdOZ/:14656:0::::: 2 | halt:*:9797:0::::: 3 | operator:*:9797:0::::: 4 | shutdown:*:9797:0::::: 5 | sync:*:9797:0::::: 6 | bin:*:9797:0::::: 7 | daemon:*:9797:0::::: 8 | adm:*:9797:0::::: 9 | lp:*:9797:0::::: 10 | mail:*:9797:0::::: 11 | postmaster:*:9797:0::::: 12 | news:*:9797:0::::: 13 | uucp:*:9797:0::::: 14 | games:*:9797:0::::: 15 | guest:*:9797:0::::: 16 | nobody:*:9797:0::::: 17 | sshd:!:14630:0:99999:7::: 18 | cron:!:14656:0:99999:7::: 19 | hacluster:!:15722:0:99999:7::: 20 | vtl:!:15744:0:99999:7::: 21 | nagios:!:15788:0:99999:7::: 22 | nutmon:!:16129:0:99999:7::: 23 | qemu:!:18654:0:99999:7::: 24 | -------------------------------------------------------------------------------- /etc/ssmtp/revaliases: -------------------------------------------------------------------------------- 1 | # sSMTP aliases 2 | # 3 | # Format: local_account:outgoing_address:mailhub 4 | # 5 | # Example: root:your_login@your.domain:mailhub.your.domain[:port] 6 | # where [:port] is an optional port number that defaults to 25. 7 | -------------------------------------------------------------------------------- /etc/ssmtp/ssmtp.conf: -------------------------------------------------------------------------------- 1 | # Default sSMTP configuration file 2 | 3 | root=postmaster 4 | mailhub=mail:25 5 | hostname=_HOSTNAME_ 6 | authuser= 7 | authpass= 8 | authmethod= 9 | usetls=NO 10 | usestarttls=NO 11 | 12 | -------------------------------------------------------------------------------- /etc/sysconfig/sbd: -------------------------------------------------------------------------------- 1 | ## Type: string 2 | ## Default: "" 3 | # 4 | # SBD_DEVICE specifies the devices to use for exchanging sbd messages 5 | # and to monitor. If specifying more than one path, use ";" as 6 | # separator. 7 | # 8 | #SBD_DEVICE="" 9 | 10 | ## Type: yesno 11 | ## Default: yes 12 | # 13 | # Whether to enable the pacemaker integration. 14 | # 15 | SBD_PACEMAKER=yes 16 | 17 | ## Type: list(always,clean) 18 | ## Default: always 19 | # 20 | # Specify the start mode for sbd. Setting this to "clean" will only 21 | # allow sbd to start if it was not previously fenced. See the -S option 22 | # in the man page. 23 | # 24 | SBD_STARTMODE=always 25 | 26 | ## Type: yesno / integer 27 | ## Default: no 28 | # 29 | # Whether to delay after starting sbd on boot for "msgwait" seconds. 30 | # This may be necessary if your cluster nodes reboot so fast that the 31 | # other nodes are still waiting in the fence acknowledgement phase. 32 | # This is an occasional issue with virtual machines. 33 | # 34 | # This can also be enabled by being set to a specific delay value, in 35 | # seconds. Sometimes a longer delay than the default, "msgwait", is 36 | # needed, for example in the cases where it's considered to be safer to 37 | # wait longer than: 38 | # corosync token timeout + consensus timeout + pcmk_delay_max + msgwait 39 | # 40 | # Be aware that the special value "1" means "yes" rather than "1s". 41 | # 42 | # Consider that you might have to adapt the startup-timeout accordingly 43 | # if the default isn't sufficient. (TimeoutStartSec for systemd) 44 | # 45 | # This option may be ignored at a later point, once pacemaker handles 46 | # this case better. 47 | # 48 | SBD_DELAY_START=no 49 | 50 | ## Type: string 51 | ## Default: /dev/watchdog 52 | # 53 | # Watchdog device to use. If set to /dev/null, no watchdog device will 54 | # be used. 55 | # 56 | SBD_WATCHDOG_DEV=/dev/watchdog 57 | 58 | ## Type: integer 59 | ## Default: 5 60 | # 61 | # How long, in seconds, the watchdog will wait before panicking the 62 | # node if no-one tickles it. 63 | # 64 | # This depends mostly on your storage latency; the majority of devices 65 | # must be successfully read within this time, or else the node will 66 | # self-fence. 67 | # 68 | # If your sbd device(s) reside on a multipath setup or iSCSI, this 69 | # should be the time required to detect a path failure. 70 | # 71 | SBD_WATCHDOG_TIMEOUT=5 72 | 73 | ## Type: string 74 | ## Default: "flush,reboot" 75 | # 76 | # Actions to be executed when the watchers don't timely report to the sbd 77 | # master process or one of the watchers detects that the master process 78 | # has died. 79 | # 80 | # Set timeout-action to comma-separated combination of 81 | # noflush|flush plus reboot|crashdump|off. 82 | # If just one of both is given the other stays at the default. 83 | # 84 | # This doesn't affect actions like off, crashdump, reboot explicitly 85 | # triggered via message slots. 86 | # And it does as well not configure the action a watchdog would 87 | # trigger should it run off (there is no generic interface). 88 | # 89 | SBD_TIMEOUT_ACTION=flush,reboot 90 | 91 | ## Type: string 92 | ## Default: "" 93 | # 94 | # Additional options for starting sbd 95 | # 96 | SBD_OPTS= 97 | -------------------------------------------------------------------------------- /etc/sysctl.conf: -------------------------------------------------------------------------------- 1 | # Enables source route verification 2 | net.ipv4.conf.default.rp_filter = 1 3 | 4 | # Enable reverse path 5 | net.ipv4.conf.all.rp_filter = 1 6 | 7 | # Reboot after a kernel panic 8 | kernel.panic = 5 9 | 10 | # Performance tweaks (from OFED) 11 | net.ipv4.tcp_timestamps = 0 12 | net.ipv4.tcp_sack = 0 13 | net.core.netdev_max_backlog = 250000 14 | net.core.rmem_max = 16777216 15 | net.core.wmem_max = 16777216 16 | net.core.rmem_default = 16777216 17 | net.core.wmem_default = 16777216 18 | net.core.optmem_max = 16777216 19 | net.ipv4.tcp_mem = 16777216 16777216 16777216 20 | net.ipv4.tcp_rmem = 4096 87380 16777216 21 | net.ipv4.tcp_wmem = 4096 65536 16777216 22 | 23 | # For core dumps 24 | kernel.core_uses_pid = 1 25 | kernel.core_pattern = /tmp/core-%e-%s-%u-%g-%p-%t 26 | fs.suid_dumpable = 2 27 | 28 | # Panic on NMI 29 | kernel.panic_on_io_nmi = 1 30 | kernel.panic_on_unrecovered_nmi = 1 31 | 32 | # Virtual memory settings 33 | vm.overcommit_memory = 2 34 | vm.overcommit_ratio = 95 35 | vm.admin_reserve_kbytes = 131072 36 | 37 | # Packet scheduling algorithm 38 | net.core.default_qdisc = pfifo_fast 39 | 40 | -------------------------------------------------------------------------------- /etc/syslog.conf: -------------------------------------------------------------------------------- 1 | # Some standard log files; log by facility 2 | kern.* -/var/log/kern.log 3 | user.* -/var/log/user.log 4 | mail.* -/var/log/mail.log 5 | daemon.* -/var/log/daemon.log 6 | auth.* -/var/log/auth.log 7 | syslog.* -/var/log/syslog.log 8 | lpr.* -/var/log/lpr.log 9 | news.* -/var/log/news.log 10 | uucp.* -/var/log/uucp.log 11 | authpriv.* -/var/log/authpriv.log 12 | ftp.* -/var/log/ftp.log 13 | cron.* -/var/log/cron.log 14 | local0.* -/var/log/local0.log 15 | local1.* -/var/log/local1.log 16 | local2.* -/var/log/local2.log 17 | local3.* -/var/log/local3.log 18 | local4.* -/var/log/local4.log 19 | local5.* -/var/log/local5.log 20 | local6.* -/var/log/local6.log 21 | local7.* -/var/log/local7.log 22 | 23 | # Some `catch-all' log files 24 | *.=debug;auth,authpriv.none;news.none;mail.none -/var/log/debug 25 | *.=info;*.=notice;*.=warn;auth,authpriv.none;cron,daemon.none;mail,news.none -/var/log/messages 26 | 27 | # Emergencies and alerts are sent to everybody logged in 28 | *.emerg * 29 | *.=alert * 30 | -------------------------------------------------------------------------------- /etc/ups.conf: -------------------------------------------------------------------------------- 1 | # Network UPS Tools: example ups.conf 2 | # 3 | # --- SECURITY NOTE --- 4 | # 5 | # If you use snmp-ups and set a community string in here, you 6 | # will have to secure this file to keep other users from obtaining 7 | # that string. It needs to be readable by upsdrvctl and any drivers, 8 | # and by upsd. 9 | # 10 | # --- 11 | # 12 | # This is where you configure all the UPSes that this system will be 13 | # monitoring directly. These are usually attached to serial ports, but 14 | # USB devices and SNMP devices are also supported. 15 | # 16 | # This file is used by upsdrvctl to start and stop your driver(s), and 17 | # is also used by upsd to determine which drivers to monitor. The 18 | # drivers themselves also read this file for configuration directives. 19 | # 20 | # The general form is: 21 | # 22 | # [upsname] 23 | # driver = 24 | # port = 25 | # < any other directives here > 26 | # 27 | # The section header ([upsname]) can be just about anything as long as 28 | # it is a single word inside brackets. upsd uses this to uniquely 29 | # identify a UPS on this system. 30 | # 31 | # If you have a UPS called snoopy, your section header would be "[snoopy]". 32 | # On a system called "doghouse", the line in your upsmon.conf to monitor 33 | # it would look something like this: 34 | # 35 | # MONITOR snoopy@doghouse 1 upsmonuser mypassword master 36 | # 37 | # It might look like this if monitoring in slave mode: 38 | # 39 | # MONITOR snoopy@doghouse 1 upsmonuser mypassword slave 40 | # 41 | # Configuration directives 42 | # ------------------------ 43 | # 44 | # These directives are common to all drivers that support ups.conf: 45 | # 46 | # driver: REQUIRED. Specify the program to run to talk to this UPS. 47 | # apcsmart, bestups, and sec are some examples. 48 | # 49 | # port: REQUIRED. The serial port where your UPS is connected. 50 | # /dev/ttyS0 is usually the first port on Linux boxes, for example. 51 | # 52 | # sdorder: optional. When you have multiple UPSes on your system, you 53 | # usually need to turn them off in a certain order. upsdrvctl 54 | # shuts down all the 0s, then the 1s, 2s, and so on. To exclude 55 | # a UPS from the shutdown sequence, set this to -1. 56 | # 57 | # The default value for this parameter is 0. 58 | # 59 | # nolock: optional, and not recommended for use in this file. 60 | # 61 | # If you put nolock in here, the driver will not lock the 62 | # serial port every time it starts. This may allow other 63 | # processes to seize the port if you start more than one by 64 | # mistake. 65 | # 66 | # This is only intended to be used on systems where locking 67 | # absolutely must be disabled for the software to work. 68 | # 69 | # maxstartdelay: optional. This can be set as a global variable 70 | # above your first UPS definition and it can also be 71 | # set in a UPS section. This value controls how long 72 | # upsdrvctl will wait for the driver to finish starting. 73 | # This keeps your system from getting stuck due to a 74 | # broken driver or UPS. 75 | # 76 | # The default is 45 seconds. 77 | # 78 | # 79 | # Anything else is passed through to the hardware-specific part of 80 | # the driver. 81 | # 82 | # Examples 83 | # -------- 84 | # 85 | # A simple example for a UPS called "powerpal" that uses the blazer_ser 86 | # driver on /dev/ttyS0 is: 87 | # 88 | # [powerpal] 89 | # driver = blazer_ser 90 | # port = /dev/ttyS0 91 | # desc = "Web server" 92 | # 93 | # If your UPS driver requires additional settings, you can specify them 94 | # here. For example, if it supports a setting of "1234" for the 95 | # variable "cable", it would look like this: 96 | # 97 | # [myups] 98 | # driver = mydriver 99 | # port = /dev/ttyS1 100 | # cable = 1234 101 | # desc = "Something descriptive" 102 | # 103 | # To find out if your driver supports any extra settings, start it with 104 | # the -h option and/or read the driver's documentation. 105 | -------------------------------------------------------------------------------- /etc/upsd.users: -------------------------------------------------------------------------------- 1 | # Network UPS Tools: Example upsd.users 2 | # 3 | # This file sets the permissions for upsd - the UPS network daemon. 4 | # Users are defined here, are given passwords, and their privileges are 5 | # controlled here too. Since this file will contain passwords, keep it 6 | # secure, with only enough permissions for upsd to read it. 7 | 8 | # -------------------------------------------------------------------------- 9 | 10 | # Each user gets a section. To start a section, put the username in 11 | # brackets on a line by itself. To set something for that user, specify 12 | # it under that section heading. The username is case-sensitive, so 13 | # admin and AdMiN are two different users. 14 | # 15 | # Possible settings: 16 | # 17 | # password: The user's password. This is case-sensitive. 18 | # 19 | # -------------------------------------------------------------------------- 20 | # 21 | # actions: Let the user do certain things with upsd. 22 | # 23 | # Valid actions are: 24 | # 25 | # SET - change the value of certain variables in the UPS 26 | # FSD - set the "forced shutdown" flag in the UPS 27 | # 28 | # -------------------------------------------------------------------------- 29 | # 30 | # instcmds: Let the user initiate specific instant commands. Use "ALL" 31 | # to grant all commands automatically. There are many possible 32 | # commands, so use 'upscmd -l' to see what your hardware supports. Here 33 | # are a few examples: 34 | # 35 | # test.panel.start - Start a front panel test 36 | # test.battery.start - Start battery test 37 | # test.battery.stop - Stop battery test 38 | # calibrate.start - Start calibration 39 | # calibrate.stop - Stop calibration 40 | # 41 | # -------------------------------------------------------------------------- 42 | # 43 | # Example: 44 | # 45 | # [admin] 46 | # password = mypass 47 | # actions = SET 48 | # instcmds = ALL 49 | # 50 | 51 | # 52 | # --- Configuring for a user who can execute tests only 53 | # 54 | # [testuser] 55 | # password = pass 56 | # instcmds = test.battery.start 57 | # instcmds = test.battery.stop 58 | 59 | # 60 | # --- Configuring for upsmon 61 | # 62 | # To add a user for your upsmon, use this example: 63 | # 64 | # [upsmon] 65 | # password = pass 66 | # upsmon master 67 | # or 68 | # upsmon slave 69 | # 70 | # The matching MONITOR line in your upsmon.conf would look like this: 71 | # 72 | # MONITOR myups@localhost 1 upsmon pass master (or slave) 73 | -------------------------------------------------------------------------------- /etc/upssched.conf: -------------------------------------------------------------------------------- 1 | # Network UPS Tools - upssched.conf sample file 2 | # 3 | # ============================================================================ 4 | # 5 | # CMDSCRIPT 6 | # 7 | # This script gets called to invoke commands for timers that trigger. 8 | # It is given a single argument - the in your 9 | # AT ... START-TIMER defines. 10 | # 11 | # *** This must be defined *before* the first AT line. Otherwise the 12 | # program will complain and exit without doing anything. 13 | # 14 | # A shell script with a big case..esac construct should work nicely for this. 15 | # An example has been provided to help you get started. 16 | 17 | CMDSCRIPT /usr/bin/upssched-cmd 18 | 19 | # ============================================================================ 20 | # 21 | # PIPEFN 22 | # 23 | # This sets the file name of the FIFO that will pass communications between 24 | # processes to start and stop timers. This should be set to some path where 25 | # normal users can't create the file, due to the possibility of symlinking 26 | # and other evil. 27 | # 28 | # Note: if you are running Solaris or similar, the permissions that 29 | # upssched sets on this file *are not enough* to keep you safe. If 30 | # your OS ignores the permissions on a FIFO, then you MUST put this in 31 | # a protected directory! 32 | # 33 | # Note 2: by default, upsmon will run upssched as whatever user you have 34 | # defined with RUN_AS_USER in upsmon.conf. Make sure that user can 35 | # create files and write to files in the path you use for PIPEFN and 36 | # LOCKFN. 37 | # 38 | # My recommendation: create a special directory for upssched, make it 39 | # owned by your upsmon user, then use it for both. 40 | # 41 | # This is commented out by default to make you visit this file and think 42 | # about how your system works before potentially opening a hole. 43 | # 44 | # PIPEFN /var/state/ups/upssched/upssched.pipe 45 | 46 | # ============================================================================ 47 | # 48 | # LOCKFN 49 | # 50 | # REQUIRED. This was added after version 1.2.1. 51 | # 52 | # upssched needs to be able to create this filename in order to avoid 53 | # a race condition when two events are dispatched from upsmon at nearly 54 | # the same time. This file will only exist briefly. It must not be 55 | # created by any other process. 56 | # 57 | # You should put this in the same directory as PIPEFN. 58 | # 59 | # LOCKFN /var/state/ups/upssched/upssched.lock 60 | 61 | # ============================================================================ 62 | # 63 | # AT 64 | # 65 | # Define a handler for a specific event on UPS . 66 | # 67 | # can be the special value * to apply this handler to every 68 | # possible value of . 69 | # 70 | # Run the command via your CMDSCRIPT when it happens. 71 | # 72 | # Note that any AT that matches both the and the 73 | # for the current event will be used. 74 | 75 | # ============================================================================ 76 | # 77 | # Possible AT commands 78 | # 79 | # - START-TIMER 80 | # 81 | # Start a timer called that will trigger after 82 | # seconds, calling your CMDSCRIPT with as the first 83 | # argument. 84 | # 85 | # Example: 86 | # Start a timer that'll execute when any UPS (*) has been gone 10 seconds 87 | # 88 | # AT COMMBAD * START-TIMER upsgone 10 89 | 90 | # ----------------------------------------------------------------------- 91 | # 92 | # - CANCEL-TIMER [cmd] 93 | # 94 | # Cancel a running timer called , if possible. If the timer 95 | # has passed then pass the optional argument to CMDSCRIPT. 96 | # 97 | # Example: 98 | # If a specific UPS (myups@localhost) comes back online, then stop the 99 | # timer before it triggers 100 | # 101 | # AT COMMOK myups@localhost CANCEL-TIMER upsgone 102 | 103 | # ----------------------------------------------------------------------- 104 | # 105 | # - EXECUTE 106 | # 107 | # Immediately pass as an argument to CMDSCRIPT. 108 | # 109 | # Example: 110 | # If any UPS (*) reverts to utility power, then execute 111 | # 'ups-back-on-line' via CMDSCRIPT. 112 | # 113 | # AT ONLINE * EXECUTE ups-back-on-line 114 | -------------------------------------------------------------------------------- /install.vbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantum/esos/e1c7346b11b65a4ea30c07216f2201ffbcf19732/install.vbs -------------------------------------------------------------------------------- /isolinux/boot.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantum/esos/e1c7346b11b65a4ea30c07216f2201ffbcf19732/isolinux/boot.cat -------------------------------------------------------------------------------- /isolinux/isolinux.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantum/esos/e1c7346b11b65a4ea30c07216f2201ffbcf19732/isolinux/isolinux.bin -------------------------------------------------------------------------------- /isolinux/isolinux.cfg: -------------------------------------------------------------------------------- 1 | default menu.c32 2 | 3 | menu title @@ver_string@@ 4 | 5 | label Boot into ESOS Live Environment 6 | kernel vmlinuz 7 | append initrd=initrd.img slot=PRIMARY consoleblank=600 console=tty0 raid=noautodetect noiswmd nodmraid esos_iso=live 8 | 9 | label ESOS ISO Installer Script 10 | kernel vmlinuz 11 | append initrd=initrd.img slot=PRIMARY consoleblank=600 console=tty0 raid=noautodetect noiswmd nodmraid esos_iso=install 12 | 13 | -------------------------------------------------------------------------------- /isolinux/menu.c32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quantum/esos/e1c7346b11b65a4ea30c07216f2201ffbcf19732/isolinux/menu.c32 -------------------------------------------------------------------------------- /make_changelog.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Get the last commit message 4 | if ! msg="$(git log -1 --pretty=%B)"; then 5 | exit 1 6 | fi 7 | 8 | # Generate the new ChangeLog file 9 | ./gitlog-to-changelog --ignore-matching="updated changelog" > ChangeLog 10 | 11 | # Stage the new file and commit it 12 | git add ChangeLog || exit 1 13 | git commit --amend -m "${msg}" || exit 1 14 | 15 | -------------------------------------------------------------------------------- /misc/cdk-5.0-20161210.patch: -------------------------------------------------------------------------------- 1 | --- a/configure 2016-11-20 10:18:36.000000000 -0500 2 | +++ b/configure 2017-02-11 15:01:21.315653217 -0500 3 | @@ -5625,7 +5625,7 @@ 4 | echo "$as_me: error: Cannot find libtool" >&2;} 5 | { (exit 1); exit 1; }; } 6 | fi 7 | - LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${top_srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} $(LIBS) -o' 8 | + LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${top_srcdir}/VERSION` ${LDFLAGS} ${LIBTOOL_OPTS} ${LT_UNDEF} $(LIBS) -o' 9 | LIB_OBJECT='${OBJECTS:.o=.lo}' 10 | LIB_SUFFIX=.la 11 | LIB_CLEAN='${LIBTOOL} --mode=clean' 12 | --- a/menu.c 2016-11-20 13:56:05.000000000 -0500 13 | +++ b/menu.c 2017-02-11 15:05:32.227412552 -0500 14 | @@ -61,8 +61,22 @@ 15 | /* *INDENT-EQLS* */ 16 | int x1 = (menuLocation[x] == LEFT) ? x : rightcount--; 17 | int x2; 18 | - int y1 = (menuPos == BOTTOM) ? (ymax - 1) : 0; 19 | - int y2 = (menuPos == BOTTOM) ? (ymax - subsize[x] - 2) : TITLELINES; 20 | + int y1, y2; 21 | + if (menuPos == BOTTOM) 22 | + { 23 | + y1 = ymax - 1; 24 | + y2 = ymax - subsize[x] - 2; 25 | + } 26 | + else if (menuPos == TOP) 27 | + { 28 | + y1 = 0; 29 | + y2 = TITLELINES; 30 | + } 31 | + else 32 | + { 33 | + y1 = menuPos; 34 | + y2 = menuPos + TITLELINES; 35 | + } 36 | int high = subsize[x] + TITLELINES; 37 | int max = -1; 38 | 39 | -------------------------------------------------------------------------------- /misc/cdk-5.0-20190303.patch: -------------------------------------------------------------------------------- 1 | diff -Naur cdk-5.0-20190303.orig/configure cdk-5.0-20190303/configure 2 | --- cdk-5.0-20190303.orig/configure 2019-02-14 02:16:11.000000000 -0800 3 | +++ cdk-5.0-20190303/configure 2019-05-01 14:13:31.000722354 -0700 4 | @@ -6340,7 +6340,7 @@ 5 | echo "$as_me: error: Cannot find libtool" >&2;} 6 | { (exit 1); exit 1; }; } 7 | fi 8 | - LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${libdir} ${LIBTOOL_VERSION} `cut -f1 ${top_srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} $(LIBS) -o' 9 | + LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${top_srcdir}/VERSION` ${LDFLAGS} ${LIBTOOL_OPTS} ${LT_UNDEF} $(LIBS) -o' 10 | LIB_OBJECT='${OBJECTS:.o=.lo}' 11 | LIB_SUFFIX=.la 12 | LIB_CLEAN='${LIBTOOL} --mode=clean' 13 | diff -Naur cdk-5.0-20190303.orig/menu.c cdk-5.0-20190303/menu.c 14 | --- cdk-5.0-20190303.orig/menu.c 2016-11-20 10:56:05.000000000 -0800 15 | +++ cdk-5.0-20190303/menu.c 2019-05-01 14:15:23.370716288 -0700 16 | @@ -61,8 +61,22 @@ 17 | /* *INDENT-EQLS* */ 18 | int x1 = (menuLocation[x] == LEFT) ? x : rightcount--; 19 | int x2; 20 | - int y1 = (menuPos == BOTTOM) ? (ymax - 1) : 0; 21 | - int y2 = (menuPos == BOTTOM) ? (ymax - subsize[x] - 2) : TITLELINES; 22 | + int y1, y2; 23 | + if (menuPos == BOTTOM) 24 | + { 25 | + y1 = ymax - 1; 26 | + y2 = ymax - subsize[x] - 2; 27 | + } 28 | + else if (menuPos == TOP) 29 | + { 30 | + y1 = 0; 31 | + y2 = TITLELINES; 32 | + } 33 | + else 34 | + { 35 | + y1 = menuPos; 36 | + y2 = menuPos + TITLELINES; 37 | + } 38 | int high = subsize[x] + TITLELINES; 39 | int max = -1; 40 | 41 | -------------------------------------------------------------------------------- /misc/dlm-4.0.8.patch: -------------------------------------------------------------------------------- 1 | --- a/dlm_controld/main.c 2019-04-20 22:41:49.000000000 -0400 2 | +++ b/dlm_controld/main.c 2021-12-04 20:32:56.012502365 -0500 3 | @@ -1034,6 +1034,8 @@ 4 | } 5 | if (daemon_quit) { 6 | log_error("shutdown ignored, active lockspaces"); 7 | + list_for_each_entry(ls, &lockspaces, list) 8 | + log_error("active lockspace %s", ls->name); 9 | daemon_quit = 0; 10 | } 11 | continue; 12 | --- dlm-4.0.8.orig/libdlm/libdlm.c 2022-08-03 12:33:05.722803287 -0400 13 | +++ dlm-4.0.8/libdlm/libdlm.c 2022-08-03 12:35:28.541362620 -0400 14 | @@ -343,15 +343,15 @@ 15 | static int find_control_minor(int *minor) 16 | { 17 | FILE *f; 18 | - char name[256]; 19 | + char name[256], buf[256]; 20 | int found = 0, m = 0; 21 | 22 | f = fopen("/proc/misc", "r"); 23 | if (!f) 24 | return -1; 25 | 26 | - while (!feof(f)) { 27 | - if (fscanf(f, "%d %s", &m, name) != 2) 28 | + while (fgets(buf, 255, f)) { 29 | + if (sscanf(buf, "%d %s", &m, name) != 2) 30 | continue; 31 | if (strcmp(name, DLM_CONTROL_NAME)) 32 | continue; 33 | -------------------------------------------------------------------------------- /misc/docbook-xsl-nons-1.79.2.patch: -------------------------------------------------------------------------------- 1 | Submitted By: Bruce Dubbs 2 | Date: 2018-01-01 3 | Initial Package Version: 1.78.1 4 | Upstream Status: Unsure 5 | Origin: Peter De Wachter 6 | Description: use EXSLT "replace" function when available 7 | A recursive implementation of string.subst is problematic, 8 | long strings with many matches will cause stack overflows. 9 | Author: Peter De Wachter 10 | Bug-Debian: https://bugs.debian.org/750593 11 | 12 | Rediffed for 1.79.2 by Bruce Dubbs 13 | 14 | diff -Naur docbook-xsl-1.79.2.orig/lib/lib.xsl docbook-xsl-1.79.2/lib/lib.xsl 15 | --- docbook-xsl-1.79.2.orig/lib/lib.xsl 2016-12-09 16:41:39.000000000 -0600 16 | +++ docbook-xsl-1.79.2/lib/lib.xsl 2018-01-01 12:54:52.507332514 -0600 17 | @@ -6,7 +6,11 @@ 18 | 19 | This module implements DTD-independent functions 20 | 21 | - ******************************************************************** --> 22 | + ******************************************************************** --> 23 | + 27 | 28 | 29 | 30 | @@ -52,6 +56,9 @@ 31 | 32 | 33 | 34 | + 35 | + 36 | + 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /misc/drbd_xsltproc/drbd-xmlproc: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Adapted for DRBD configuration files by Marc A. Smith. 4 | # 5 | # Originally "corosync-xmlproc" from the Corosync project: 6 | # Copyright (c) 2011 Red Hat, Inc. All rights reserved. 7 | # Author: Jan Friesse (jfriesse@redhat.com) 8 | # 9 | # This software licensed under BSD license, the text of which follows: 10 | # 11 | # Redistribution and use in source and binary forms, with or without 12 | # modification, are permitted provided that the following conditions are met: 13 | # 14 | # - Redistributions of source code must retain the above copyright notice, 15 | # this list of conditions and the following disclaimer. 16 | # - Redistributions in binary form must reproduce the above copyright notice, 17 | # this list of conditions and the following disclaimer in the documentation 18 | # and/or other materials provided with the distribution. 19 | # - Neither the name of the Red Hat, Inc. nor the names of its 20 | # contributors may be used to endorse or promote products derived from this 21 | # software without specific prior written permission. 22 | # 23 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 27 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 33 | # THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | XSLT_PROC=/usr/bin/xsltproc 36 | XSL_FILE=/usr/local/share/drbd/xml2conf.xsl 37 | 38 | usage() { 39 | echo "$0 input_config [output]" 40 | echo " where input_config is valid XML configuration file" 41 | 42 | exit 1 43 | } 44 | 45 | [ "$1" == "" ] && usage 46 | 47 | $XSLT_PROC -V >/dev/null 2>&1 48 | if [ "$?" != 0 ];then 49 | echo "Can't find xslt processor $XSLT_PROC" 50 | exit 2 51 | fi 52 | 53 | # TODO: 54 | # Validation should occur before actual processing 55 | 56 | [ "$2" != "" ] && out_param="-o $2" 57 | 58 | $XSLT_PROC --stringparam inputfile "$1" $out_param $XSL_FILE "$1" 59 | 60 | -------------------------------------------------------------------------------- /misc/glibc-2.29.patch: -------------------------------------------------------------------------------- 1 | Submitted By: Armin K. 2 | Date: 2013-02-11 3 | Initial Package Version: 2.17 4 | Upstream Status: Not Applicable 5 | Origin: Self 6 | Description: This patch removes references to /var/db directory which is not part 7 | of FHS and replaces them with more suitable directories in /var 8 | hierarchy - /var/cache/nscd for nscd and /var/lib/nss_db for nss_db. 9 | 10 | --- a/Makeconfig 2012-12-25 04:02:13.000000000 +0100 11 | +++ b/Makeconfig 2013-02-11 01:32:32.500667439 +0100 12 | @@ -250,7 +250,7 @@ 13 | 14 | # Directory for the database files and Makefile for nss_db. 15 | ifndef vardbdir 16 | -vardbdir = $(localstatedir)/db 17 | +vardbdir = $(localstatedir)/lib/nss_db 18 | endif 19 | inst_vardbdir = $(install_root)$(vardbdir) 20 | 21 | --- a/nscd/nscd.h 2012-12-25 04:02:13.000000000 +0100 22 | +++ b/nscd/nscd.h 2013-02-11 01:32:32.500667439 +0100 23 | @@ -112,11 +112,11 @@ 24 | 25 | 26 | /* Paths of the file for the persistent storage. */ 27 | -#define _PATH_NSCD_PASSWD_DB "/var/db/nscd/passwd" 28 | -#define _PATH_NSCD_GROUP_DB "/var/db/nscd/group" 29 | -#define _PATH_NSCD_HOSTS_DB "/var/db/nscd/hosts" 30 | -#define _PATH_NSCD_SERVICES_DB "/var/db/nscd/services" 31 | -#define _PATH_NSCD_NETGROUP_DB "/var/db/nscd/netgroup" 32 | +#define _PATH_NSCD_PASSWD_DB "/var/cache/nscd/passwd" 33 | +#define _PATH_NSCD_GROUP_DB "/var/cache/nscd/group" 34 | +#define _PATH_NSCD_HOSTS_DB "/var/cache/nscd/hosts" 35 | +#define _PATH_NSCD_SERVICES_DB "/var/cache/nscd/services" 36 | +#define _PATH_NSCD_NETGROUP_DB "/var/cache/nscd/netgroup" 37 | 38 | /* Path used when not using persistent storage. */ 39 | #define _PATH_NSCD_XYZ_DB_TMP "/var/run/nscd/dbXXXXXX" 40 | --- a/nss/db-Makefile 2012-12-25 04:02:13.000000000 +0100 41 | +++ b/nss/db-Makefile 2013-02-11 01:32:32.500667439 +0100 42 | @@ -22,7 +22,7 @@ 43 | /etc/rpc /etc/services /etc/shadow /etc/gshadow \ 44 | /etc/netgroup) 45 | 46 | -VAR_DB = /var/db 47 | +VAR_DB = /var/lib/nss_db 48 | 49 | AWK = awk 50 | MAKEDB = makedb --quiet 51 | --- a/sysdeps/generic/paths.h 2012-12-25 04:02:13.000000000 +0100 52 | +++ b/sysdeps/generic/paths.h 2013-02-11 01:32:32.500667439 +0100 53 | @@ -68,7 +68,7 @@ 54 | /* Provide trailing slash, since mostly used for building pathnames. */ 55 | #define _PATH_DEV "/dev/" 56 | #define _PATH_TMP "/tmp/" 57 | -#define _PATH_VARDB "/var/db/" 58 | +#define _PATH_VARDB "/var/lib/nss_db/" 59 | #define _PATH_VARRUN "/var/run/" 60 | #define _PATH_VARTMP "/var/tmp/" 61 | 62 | --- a/sysdeps/unix/sysv/linux/paths.h 2012-12-25 04:02:13.000000000 +0100 63 | +++ b/sysdeps/unix/sysv/linux/paths.h 2013-02-11 01:32:32.504000831 +0100 64 | @@ -68,7 +68,7 @@ 65 | /* Provide trailing slash, since mostly used for building pathnames. */ 66 | #define _PATH_DEV "/dev/" 67 | #define _PATH_TMP "/tmp/" 68 | -#define _PATH_VARDB "/var/db/" 69 | +#define _PATH_VARDB "/var/lib/nss_db/" 70 | #define _PATH_VARRUN "/var/run/" 71 | #define _PATH_VARTMP "/var/tmp/" 72 | 73 | -------------------------------------------------------------------------------- /misc/glibc.SUPPORTED.locales: -------------------------------------------------------------------------------- 1 | # This file names the currently supported and somewhat tested locales. 2 | # If you have any additions please file a glibc bug report. 3 | SUPPORTED-LOCALES=\ 4 | cs_CZ.UTF-8/UTF-8 \ 5 | de_DE.UTF-8/UTF-8 \ 6 | de_DE/ISO-8859-1 \ 7 | de_DE@euro/ISO-8859-15 \ 8 | el_GR/ISO-8859-7 \ 9 | en_GB.UTF-8/UTF-8 \ 10 | en_GB/ISO-8859-1 \ 11 | en_HK/ISO-8859-1 \ 12 | en_PH/ISO-8859-1 \ 13 | en_US.UTF-8/UTF-8 \ 14 | en_US/ISO-8859-1 \ 15 | es_MX/ISO-8859-1 \ 16 | fa_IR/UTF-8 \ 17 | fr_FR.UTF-8/UTF-8 \ 18 | fr_FR/ISO-8859-1 \ 19 | fr_FR@euro/ISO-8859-15 \ 20 | it_IT.UTF-8/UTF-8 \ 21 | it_IT/ISO-8859-1 \ 22 | ja_JP.EUC-JP/EUC-JP \ 23 | ja_JP.UTF-8/UTF-8 \ 24 | ru_RU.KOI8-R/KOI8-R \ 25 | ru_RU.UTF-8/UTF-8 \ 26 | tr_TR.UTF-8/UTF-8 \ 27 | zh_CN.GB18030/GB18030 \ 28 | zh_HK/BIG5-HKSCS \ 29 | -------------------------------------------------------------------------------- /misc/grub-2.02.patch: -------------------------------------------------------------------------------- 1 | Submitted By: Xi Ruoyao 2 | Date: 2019-01-10 3 | Initial Package Version: 2.02 4 | Upstream Status: Comitted 5 | Origin: Upstream git repository 6 | Description: x86_64 assembler in binutils-2.31 generates 7 | R_X86_64_PLT32. Grub2 should treat it as 8 | R_X86_64_PC32. 9 | 10 | diff -Naur grub-2.02.old/util/grub-mkimagexx.c grub-2.02.new/util/grub-mkimagexx.c 11 | --- grub-2.02.old/util/grub-mkimagexx.c 2017-04-24 17:16:00.000000000 +0800 12 | +++ grub-2.02.new/util/grub-mkimagexx.c 2019-01-10 01:09:53.027377424 +0800 13 | @@ -832,6 +832,7 @@ 14 | break; 15 | 16 | case R_X86_64_PC32: 17 | + case R_X86_64_PLT32: 18 | { 19 | grub_uint32_t *t32 = (grub_uint32_t *) target; 20 | *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32) 21 | diff -Naur grub-2.02.old/util/grub-module-verifier.c grub-2.02.new/util/grub-module-verifier.c 22 | --- grub-2.02.old/util/grub-module-verifier.c 2017-04-24 17:16:00.000000000 +0800 23 | +++ grub-2.02.new/util/grub-module-verifier.c 2019-01-10 01:10:07.617378227 +0800 24 | @@ -19,6 +19,7 @@ 25 | -1 26 | }, (int[]){ 27 | R_X86_64_PC32, 28 | + R_X86_64_PLT32, 29 | -1 30 | } 31 | }, 32 | -------------------------------------------------------------------------------- /misc/grub.cfg: -------------------------------------------------------------------------------- 1 | set default=0 2 | set timeout=5 3 | 4 | serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1 5 | terminal_input --append serial 6 | terminal_output --append serial 7 | 8 | insmod fat 9 | insmod ext2 10 | set root=(hd0,msdos1) 11 | search --no-floppy --label --set=root ESOS_BOOT 12 | 13 | if [ ${grub_platform} = "efi" ]; then 14 | insmod efi_gop 15 | insmod efi_uga 16 | insmod font 17 | if loadfont /grub/fonts/unicode.pf2; then 18 | set gfxmode=auto 19 | insmod gfxterm 20 | set gfxpayload=keep 21 | terminal_output gfxterm 22 | fi 23 | else 24 | insmod vbe 25 | fi 26 | 27 | source /PRIMARY-version 28 | menuentry "Primary -> @@short_prod@@ ${slot_ver} " { 29 | linux /PRIMARY-bzImage-esos.prod slot=PRIMARY \ 30 | crashkernel=0M-2G:128M,2G-6G:256M,6G-8G:512M,8G-:768M \ 31 | consoleblank=600 console=tty0 raid=noautodetect noiswmd nodmraid 32 | initrd /PRIMARY-initramfs.cpio.gz 33 | } 34 | if [ -e "/PRIMARY-bzImage-esos.debug" ]; then 35 | menuentry "Primary -> @@short_prod@@ ${slot_ver} " { 36 | linux /PRIMARY-bzImage-esos.debug slot=PRIMARY \ 37 | crashkernel=0M-2G:128M,2G-6G:256M,6G-8G:512M,8G-:768M \ 38 | consoleblank=600 console=tty0 raid=noautodetect noiswmd nodmraid \ 39 | kgdboc=kms,kbd 40 | initrd /PRIMARY-initramfs.cpio.gz 41 | } 42 | fi 43 | 44 | if [ -e "/SECONDARY-version" ]; then 45 | source /SECONDARY-version 46 | menuentry "Secondary -> @@short_prod@@ ${slot_ver} " { 47 | linux /SECONDARY-bzImage-esos.prod slot=SECONDARY \ 48 | crashkernel=0M-2G:128M,2G-6G:256M,6G-8G:512M,8G-:768M \ 49 | consoleblank=600 console=tty0 raid=noautodetect noiswmd nodmraid 50 | initrd /SECONDARY-initramfs.cpio.gz 51 | } 52 | if [ -e "/SECONDARY-bzImage-esos.debug" ]; then 53 | menuentry "Secondary -> @@short_prod@@ ${slot_ver} " { 54 | linux /SECONDARY-bzImage-esos.debug slot=SECONDARY \ 55 | crashkernel=0M-2G:128M,2G-6G:256M,6G-8G:512M,8G-:768M \ 56 | consoleblank=600 console=tty0 raid=noautodetect noiswmd nodmraid \ 57 | kgdboc=kms,kbd 58 | initrd /SECONDARY-initramfs.cpio.gz 59 | } 60 | fi 61 | fi 62 | 63 | -------------------------------------------------------------------------------- /misc/ibutils-1.5.7.patch: -------------------------------------------------------------------------------- 1 | Description: Fix the Makefile dependencies 2 | Author: Adrian Bunk 3 | Bug-Debian: https://bugs.debian.org/906553 4 | 5 | --- ibutils-1.5.7+0.2.gbd7e502.orig/ibis/src/Makefile.am 6 | +++ ibutils-1.5.7+0.2.gbd7e502/ibis/src/Makefile.am 7 | @@ -53,12 +53,10 @@ LIB_VER_TRIPLET="1:0:0" 8 | LIB_FILE_TRIPLET=1.0.0 9 | 10 | lib_LTLIBRARIES = libibis.la 11 | -noinst_LIBRARIES = libibiscom.a 12 | +noinst_LTLIBRARIES = libibiscom.la 13 | 14 | -libibiscom_a_SOURCES = ibbbm.c ibcr.c ibis.c ibis_gsi_mad_ctrl.c \ 15 | +libibiscom_la_SOURCES = ibbbm.c ibcr.c ibis.c ibis_gsi_mad_ctrl.c \ 16 | ibpm.c ibsac.c ibsm.c ibvs.c ibcc.c 17 | -# Below op causes renaming of the obj files - used when same source creates 2 targets (TODO: is this duplication needed ?) 18 | -libibiscom_a_CFLAGS = $(AM_CFLAGS) 19 | 20 | # client library to be used by IBIS TCL package: 21 | libibis_la_SOURCES = ibis_wrap.c ibbbm.c ibcr.c ibis.c ibis_gsi_mad_ctrl.c \ 22 | @@ -75,7 +73,7 @@ LDADD = $(OSM_LDFLAGS) 23 | ibis_SOURCES = ibissh_wrap.cpp 24 | 25 | # note the order of the libraries does matter as we static link 26 | -ibis_LDADD = -L. -libiscom $(OSM_LDFLAGS) $(TCL_LIBS) 27 | +ibis_LDADD = -L. libibiscom.la $(OSM_LDFLAGS) $(TCL_LIBS) 28 | 29 | 30 | # SWIG FILES: 31 | -------------------------------------------------------------------------------- /misc/ipmitool-1.8.18.patch: -------------------------------------------------------------------------------- 1 | diff -urNp old/src/plugins/lanplus/lanplus_crypt_impl.c new/src/plugins/lanplus/lanplus_crypt_impl.c 2 | --- old/src/plugins/lanplus/lanplus_crypt_impl.c 2016-05-28 10:20:20.000000000 +0200 3 | +++ new/src/plugins/lanplus/lanplus_crypt_impl.c 2017-02-21 10:50:21.634873466 +0100 4 | @@ -164,10 +164,10 @@ lanplus_encrypt_aes_cbc_128(const uint8_ 5 | uint8_t * output, 6 | uint32_t * bytes_written) 7 | { 8 | - EVP_CIPHER_CTX ctx; 9 | - EVP_CIPHER_CTX_init(&ctx); 10 | - EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv); 11 | - EVP_CIPHER_CTX_set_padding(&ctx, 0); 12 | + EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); 13 | + EVP_CIPHER_CTX_init(ctx); 14 | + EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv); 15 | + EVP_CIPHER_CTX_set_padding(ctx, 0); 16 | 17 | 18 | *bytes_written = 0; 19 | @@ -191,7 +191,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_ 20 | assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); 21 | 22 | 23 | - if(!EVP_EncryptUpdate(&ctx, output, (int *)bytes_written, input, input_length)) 24 | + if(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length)) 25 | { 26 | /* Error */ 27 | *bytes_written = 0; 28 | @@ -201,7 +201,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_ 29 | { 30 | uint32_t tmplen; 31 | 32 | - if(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen)) 33 | + if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen)) 34 | { 35 | *bytes_written = 0; 36 | return; /* Error */ 37 | @@ -210,7 +210,8 @@ lanplus_encrypt_aes_cbc_128(const uint8_ 38 | { 39 | /* Success */ 40 | *bytes_written += tmplen; 41 | - EVP_CIPHER_CTX_cleanup(&ctx); 42 | + EVP_CIPHER_CTX_cleanup(ctx); 43 | + EVP_CIPHER_CTX_free(ctx); 44 | } 45 | } 46 | } 47 | @@ -239,10 +240,10 @@ lanplus_decrypt_aes_cbc_128(const uint8_ 48 | uint8_t * output, 49 | uint32_t * bytes_written) 50 | { 51 | - EVP_CIPHER_CTX ctx; 52 | - EVP_CIPHER_CTX_init(&ctx); 53 | - EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv); 54 | - EVP_CIPHER_CTX_set_padding(&ctx, 0); 55 | + EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); 56 | + EVP_CIPHER_CTX_init(ctx); 57 | + EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv); 58 | + EVP_CIPHER_CTX_set_padding(ctx, 0); 59 | 60 | 61 | if (verbose >= 5) 62 | @@ -266,7 +267,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_ 63 | assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); 64 | 65 | 66 | - if (!EVP_DecryptUpdate(&ctx, output, (int *)bytes_written, input, input_length)) 67 | + if (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length)) 68 | { 69 | /* Error */ 70 | lprintf(LOG_DEBUG, "ERROR: decrypt update failed"); 71 | @@ -277,7 +278,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_ 72 | { 73 | uint32_t tmplen; 74 | 75 | - if (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen)) 76 | + if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen)) 77 | { 78 | char buffer[1000]; 79 | ERR_error_string(ERR_get_error(), buffer); 80 | @@ -290,7 +291,8 @@ lanplus_decrypt_aes_cbc_128(const uint8_ 81 | { 82 | /* Success */ 83 | *bytes_written += tmplen; 84 | - EVP_CIPHER_CTX_cleanup(&ctx); 85 | + EVP_CIPHER_CTX_cleanup(ctx); 86 | + EVP_CIPHER_CTX_free(ctx); 87 | } 88 | } 89 | 90 | -------------------------------------------------------------------------------- /misc/irqbalance-1.8.0.patch: -------------------------------------------------------------------------------- 1 | From 9b004c6628503c15c7b9e8c66e62028123924aa1 Mon Sep 17 00:00:00 2001 2 | From: Neil Horman 3 | Date: Wed, 26 Jan 2022 08:25:58 -0500 4 | Subject: [PATCH 1/2] Ensure that we get all of a unix message 5 | 6 | receive data with MSG_TRUNC set so that we can check to see that we got 7 | everything the server sent us. 8 | 9 | Signed-off-by: Neil Horman 10 | --- 11 | ui/irqbalance-ui.c | 17 ++++++++++------- 12 | 1 file changed, 10 insertions(+), 7 deletions(-) 13 | 14 | diff --git a/ui/irqbalance-ui.c b/ui/irqbalance-ui.c 15 | index ed8f408..959b312 100644 16 | --- a/ui/irqbalance-ui.c 17 | +++ b/ui/irqbalance-ui.c 18 | @@ -21,6 +21,7 @@ GList *tree = NULL; 19 | setup_t setup; 20 | GMainLoop *main_loop; 21 | int is_tree = 1; 22 | +static int default_bufsz = 8192; 23 | 24 | struct msghdr * create_credentials_msg() 25 | { 26 | @@ -103,6 +104,7 @@ char * get_data(char *string) 27 | /* Send "setup" to get sleep interval, banned IRQs and banned CPUs, 28 | * "stats" to get CPU tree statistics 29 | */ 30 | +try_again: 31 | int socket_fd = init_connection(); 32 | if(!socket_fd) { 33 | return NULL; 34 | @@ -115,17 +117,18 @@ char * get_data(char *string) 35 | msg->msg_iov = &iov; 36 | sendmsg(socket_fd, msg, 0); 37 | 38 | - /* 39 | - * This is just...horrible. Mental note to replace this 40 | - * With a select, ioctl to determine size, and malloc based 41 | - * on that 42 | - */ 43 | - char *data = malloc(8192); 44 | - int len = recv(socket_fd, data, 8192, 0); 45 | + char *data = malloc(default_bufsz); 46 | + int len = recv(socket_fd, data, default_bufsz, MSG_TRUNC); 47 | close(socket_fd); 48 | data[len] = '\0'; 49 | free(msg->msg_control); 50 | free(msg); 51 | + if (len >= default_bufsz) { 52 | + /* msg was truncated, increase bufsz and try again */ 53 | + default_bufsz += 8192; 54 | + free(data); 55 | + goto try_again; 56 | + } 57 | return data; 58 | } 59 | 60 | 61 | From 0f594a6f19b38dd595b89636317d82de0f841522 Mon Sep 17 00:00:00 2001 62 | From: Neil Horman 63 | Date: Wed, 26 Jan 2022 09:26:38 -0500 64 | Subject: [PATCH 2/2] Separate variable declaration from assignment 65 | 66 | We need to do this to allow for the label placement on older gcc 67 | versions 68 | 69 | Signed-off-by: Neil Horman 70 | --- 71 | ui/irqbalance-ui.c | 4 +++- 72 | 1 file changed, 3 insertions(+), 1 deletion(-) 73 | 74 | diff --git a/ui/irqbalance-ui.c b/ui/irqbalance-ui.c 75 | index 959b312..3ad3553 100644 76 | --- a/ui/irqbalance-ui.c 77 | +++ b/ui/irqbalance-ui.c 78 | @@ -104,8 +104,10 @@ char * get_data(char *string) 79 | /* Send "setup" to get sleep interval, banned IRQs and banned CPUs, 80 | * "stats" to get CPU tree statistics 81 | */ 82 | + int socket_fd; 83 | + 84 | try_again: 85 | - int socket_fd = init_connection(); 86 | + socket_fd = init_connection(); 87 | if(!socket_fd) { 88 | return NULL; 89 | } 90 | -------------------------------------------------------------------------------- /misc/lessfs-1.7.0.patch: -------------------------------------------------------------------------------- 1 | diff -Naur lessfs-1.7.0.orig/lib_crypto.c lessfs-1.7.0/lib_crypto.c 2 | --- lessfs-1.7.0.orig/lib_crypto.c 2011-09-30 11:13:08.000000000 -0700 3 | +++ lessfs-1.7.0/lib_crypto.c 2019-05-01 14:05:06.730749572 -0700 4 | @@ -78,7 +78,7 @@ 5 | DAT *lfsencrypt(unsigned char *unenc, unsigned long size) 6 | { 7 | unsigned char *safepasswd; 8 | - EVP_CIPHER_CTX ctx; 9 | + EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); 10 | DAT *encoded; 11 | int olen, tlen; 12 | 13 | @@ -86,19 +86,20 @@ 14 | 15 | pthread_mutex_lock(&crypto_mutex); 16 | safepasswd = safepassword(); 17 | - EVP_CIPHER_CTX_init(&ctx); 18 | - EVP_EncryptInit(&ctx, EVP_bf_cbc(), safepasswd, config->iv); 19 | + EVP_CIPHER_CTX_init(ctx); 20 | + EVP_EncryptInit(ctx, EVP_bf_cbc(), safepasswd, config->iv); 21 | encoded = s_malloc(sizeof(DAT)); 22 | encoded->data = s_malloc(8 + size); //Blowfish can grow 64 bits 23 | 24 | - if (EVP_EncryptUpdate(&ctx, encoded->data, &olen, unenc, size) != 1) { 25 | + if (EVP_EncryptUpdate(ctx, encoded->data, &olen, unenc, size) != 1) { 26 | die_cryptoerr("error in encrypt update\n"); 27 | } 28 | 29 | - if (EVP_EncryptFinal(&ctx, encoded->data + olen, &tlen) != 1) { 30 | + if (EVP_EncryptFinal(ctx, encoded->data + olen, &tlen) != 1) { 31 | die_cryptoerr("error in encrypt final\n"); 32 | } 33 | - EVP_CIPHER_CTX_cleanup(&ctx); 34 | + EVP_CIPHER_CTX_cleanup(ctx); 35 | + EVP_CIPHER_CTX_free(ctx); 36 | encoded->size = olen + tlen; 37 | if (encoded->size > 8 + size) { 38 | die_cryptoerr 39 | @@ -123,20 +124,21 @@ 40 | decrypted->data = s_malloc(data->size); 41 | safepasswd = safepassword(); 42 | 43 | - EVP_CIPHER_CTX ctx; 44 | - EVP_CIPHER_CTX_init(&ctx); 45 | - EVP_DecryptInit(&ctx, EVP_bf_cbc(), safepasswd, config->iv); 46 | + EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); 47 | + EVP_CIPHER_CTX_init(ctx); 48 | + EVP_DecryptInit(ctx, EVP_bf_cbc(), safepasswd, config->iv); 49 | 50 | if (EVP_DecryptUpdate 51 | - (&ctx, decrypted->data, &olen, data->data, data->size) != 1) { 52 | + (ctx, decrypted->data, &olen, data->data, data->size) != 1) { 53 | die_cryptoerr("Unexpected fatal error while decrypting.\n"); 54 | } 55 | 56 | - if (EVP_DecryptFinal(&ctx, decrypted->data + olen, &tlen) != 1) { 57 | + if (EVP_DecryptFinal(ctx, decrypted->data + olen, &tlen) != 1) { 58 | die_cryptoerr("Unexpected fatal error in decrypt final.\n"); 59 | } 60 | olen += tlen; 61 | - EVP_CIPHER_CTX_cleanup(&ctx); 62 | + EVP_CIPHER_CTX_cleanup(ctx); 63 | + EVP_CIPHER_CTX_free(ctx); 64 | decrypted->size = olen; 65 | s_free(safepasswd); 66 | pthread_mutex_unlock(&crypto_mutex); 67 | -------------------------------------------------------------------------------- /misc/libvirt-6.10.0.patch: -------------------------------------------------------------------------------- 1 | --- a/meson.build 2020-12-01 03:51:29.000000000 -0500 2 | +++ b/meson.build 2020-12-24 11:06:54.818754782 -0500 3 | @@ -1295,9 +1295,10 @@ 4 | 5 | # We need this to avoid compilation issues with modern compilers. 6 | # See 9ea3424a178 for a more detailed explanation 7 | + ncursesw_dep = declare_dependency(link_args: '-lncursesw') 8 | readline_dep = declare_dependency( 9 | compile_args: [ '-D_FUNCTION_DEF' ], 10 | - dependencies: [ readline_dep ], 11 | + dependencies: [ readline_dep, ncursesw_dep ], 12 | ) 13 | 14 | conf.set('WITH_READLINE', 1) 15 | -------------------------------------------------------------------------------- /misc/mdadm-4.1.patch: -------------------------------------------------------------------------------- 1 | --- a/udev-md-raid-assembly.rules 2017-01-09 16:46:34.000000000 -0500 2 | +++ b/udev-md-raid-assembly.rules 2018-10-11 21:51:57.806607996 -0400 3 | @@ -5,6 +5,10 @@ 4 | ENV{ANACONDA}=="?*", GOTO="md_inc_end" 5 | # assemble md arrays 6 | 7 | +# If 'raid=noautodetect' is set, we shouldn't assemble MD arrays here either 8 | +IMPORT{cmdline}="raid" 9 | +ENV{raid}=="noautodetect", GOTO="md_inc_end" 10 | + 11 | SUBSYSTEM!="block", GOTO="md_inc_end" 12 | 13 | # handle potential components of arrays (the ones supported by md) 14 | -------------------------------------------------------------------------------- /misc/ncurses-6.1.patch: -------------------------------------------------------------------------------- 1 | --- a/misc/terminfo.src 2015-07-25 15:27:20.000000000 -0400 2 | +++ b/misc/terminfo.src 2017-10-13 10:38:59.445617703 -0400 3 | @@ -3962,7 +3962,7 @@ 4 | # This fragment is for people who cannot agree on what the backspace key 5 | # should send. 6 | xterm+kbs|fragment for backspace key, 7 | - kbs=^H, 8 | + kbs=\177, 9 | # 10 | # This fragment describes as much of XFree86 xterm's "pc-style" function 11 | # keys as will fit into terminfo's 60 function keys. 12 | -------------------------------------------------------------------------------- /misc/net-snmp-5.8.patch: -------------------------------------------------------------------------------- 1 | diff -Naur net-snmp-5.8-orig/agent/mibgroup/target/snmpTargetAddrEntry_data.c net-snmp-5.8/agent/mibgroup/target/snmpTargetAddrEntry_data.c 2 | --- net-snmp-5.8-orig/agent/mibgroup/target/snmpTargetAddrEntry_data.c 2018-07-16 14:33:40.000000000 +0000 3 | +++ net-snmp-5.8/agent/mibgroup/target/snmpTargetAddrEntry_data.c 2019-04-30 21:45:33.195282093 +0000 4 | @@ -25,6 +25,8 @@ 5 | #include "snmpTargetAddrEntry_data.h" 6 | #include "util_funcs/header_generic.h" 7 | 8 | +netsnmp_feature_require(container_compare_mem) 9 | + 10 | static struct targetAddrTable_struct *aAddrTable = NULL; 11 | static int _active = 0; 12 | 13 | diff -Naur net-snmp-5.8-orig/agent/mibgroup/target/snmpTargetParamsEntry_data.c net-snmp-5.8/agent/mibgroup/target/snmpTargetParamsEntry_data.c 14 | --- net-snmp-5.8-orig/agent/mibgroup/target/snmpTargetParamsEntry_data.c 2018-07-16 14:33:40.000000000 +0000 15 | +++ net-snmp-5.8/agent/mibgroup/target/snmpTargetParamsEntry_data.c 2019-04-30 21:46:03.787280441 +0000 16 | @@ -23,6 +23,8 @@ 17 | 18 | #include "snmpTargetParamsEntry_data.h" 19 | 20 | +netsnmp_feature_require(container_compare_mem) 21 | + 22 | static struct targetParamTable_struct *aPTable = NULL; 23 | static int _active = 0; 24 | 25 | -------------------------------------------------------------------------------- /misc/ocf/onesty/.common-funcs: -------------------------------------------------------------------------------- 1 | modinfo="${HA_SBIN_DIR}/modinfo" 2 | lsmod="${HA_SBIN_DIR}/lsmod" 3 | modprobe="${HA_SBIN_DIR}/modprobe" 4 | 5 | CRM_MASTER="${HA_SBIN_DIR}/crm_master -l reboot" 6 | 7 | FC_ADDR_REGEX="^([a-fA-F0-9]{2}\:){7}[a-fA-F0-9]{2}$" 8 | IB_ADDR_REGEX="^([a-fA-F0-9]{4}\:){3}[a-fA-F0-9]{4}$" 9 | LUN_REGEX="^([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$" 10 | BOOL_REGEX="^[01]$" 11 | ALPHANUM_REGEX="^[a-zA-Z0-9]+$" 12 | ALPHANUM_EXTREGEX="^[a-zA-Z0-9\-_]+$" 13 | NUMERIC_REGEX="^[0-9]+$" 14 | 15 | SCST_BASE="/sys/kernel/scst_tgt" 16 | 17 | NODE_NAME=$(${HA_SBIN_DIR}/crm_node -n) 18 | NODES=$(${HA_SBIN_DIR}/crm_node -l | awk '{print $2}') 19 | localnodeid=$(${HA_SBIN_DIR}/crm_node -i) 20 | remotenodeid=0 21 | 22 | c_load_modules() { 23 | for module in "$@" 24 | do 25 | ${modinfo} $module> /dev/null 2>&1 || { ocf_log err "Module $module not found"; return $OCF_ERR_INSTALLED; } 26 | c_start_module $module || { ocf_log err "Module $module could not be found running and could not be started."; return $OCF_ERR_INSTALLED; } 27 | done 28 | } 29 | 30 | c_start_module() { 31 | local module=$1 32 | if [ $(${lsmod} | grep -c "^$module ") -eq 0 ] 33 | then 34 | ${modprobe} $1> /dev/null 2>&1 || { ocf_log err "could not start module $1"; return $OCF_ERR_INSTALLED; } 35 | fi 36 | return $OCF_SUCCESS 37 | } 38 | 39 | c_is_in(){ 40 | for item in ${@:2} 41 | do 42 | if [[ "$1" == $item ]] 43 | then 44 | return $OCF_SUCCESS 45 | fi 46 | done 47 | return $OCF_ERR_GENERIC 48 | } 49 | 50 | c_expand_nodes() { 51 | for node in $NODES 52 | do 53 | nodeid=$(${HA_SBIN_DIR}/crm_node -l | grep $node | awk '{print $1}') 54 | nodes[$nodeid]=$node 55 | conftargetports="$(${HA_SBIN_DIR}/crm_attribute --node $node --name targetports --query | egrep -o 'value=[^ ]+' | egrep -o '[^=]+$' | tr '[:upper:]' '[:lower:]' | tr ',' ' ' 2>/dev/null)" 56 | unset targetports[$nodeid] 57 | for port in $conftargetports 58 | do 59 | if [[ ! $port =~ $FC_ADDR_REGEX ]] && [[ ! $port =~ $IB_ADDR_REGEX ]] 60 | then 61 | ocf_log err "port $port is not a valid target port address" 62 | return $OCF_ERR_CONFIGURED 63 | fi 64 | if [[ ! -z ${targetports[$nodeid]} ]] 65 | then 66 | targetports[$nodeid]=${targetports[$nodeid]}" "${port} 67 | else 68 | targetports[$nodeid]=${port} 69 | fi 70 | done 71 | done 72 | return $OCF_SUCCESS 73 | } 74 | 75 | #c_test_node_count() { 76 | # local targetnodes=0 77 | # for nodeid in ${!nodes[@]} 78 | # do 79 | # if [[ ! -z ${targetports[$nodeid]} ]] 80 | # then 81 | # if [[ $nodeid != $localnodeid ]] 82 | # then 83 | # remotenodeid=$nodeid 84 | # fi 85 | # let "targetnodes++" 86 | # fi 87 | # done 88 | 89 | # if [[ $targetnodes != 2 ]] 90 | # then 91 | # ocf_log err "exactly two nodes with target ports expected." 92 | # return $OCF_ERR_CONFIGURED 93 | # fi 94 | # return $OCF_SUCCESS 95 | #} 96 | 97 | c_test_local_ports() { 98 | if [[ ! -z ${targetports[$localnodeid]} ]] 99 | then 100 | c_load_modules ${REQUIRED_MODULES} 101 | for port in ${targetports[$localnodeid]} 102 | do 103 | if [[ ! -d $SCST_BASE/targets/$OCF_RESKEY_tgtdriver/$port ]] 104 | then 105 | ocf_log err "port $port does not exist in local system although it should" 106 | return $OCF_ERR_CONFIGURED 107 | fi 108 | done 109 | fi 110 | return $OCF_SUCCESS 111 | } 112 | 113 | c_test_instances() { 114 | if [[ $OCF_RESKEY_CRM_meta_clone_max -gt 2 ]] || [[ $OCF_RESKEY_CRM_meta_clone_node_max -gt 1 ]] 115 | then 116 | ocf_log err "maximum 1 instance per node and 2 instances per cluster allowed" 117 | return $OCF_ERR_CONFIGURED 118 | fi 119 | return $OCF_SUCCESS 120 | } 121 | 122 | c_issue_lip() { 123 | for port in ${targetports[$localnodeid]} 124 | do 125 | if [[ $(cat $SCST_BASE/targets/$OCF_RESKEY_tgtdriver/$port/enabled) == "1" ]] 126 | then 127 | ocf_log debug "issuing lip to target port $port" 128 | echo 1 > $(readlink -f $SCST_BASE/targets/$OCF_RESKEY_tgtdriver/$port/host | sed 's/scsi_host/fc_host/g')/issue_lip & 2> /dev/null 129 | fi 130 | done 131 | return $OCF_SUCCESS 132 | } 133 | -------------------------------------------------------------------------------- /misc/open-vm-tools-10.3.10-12406962.patch: -------------------------------------------------------------------------------- 1 | diff -Naur open-vm-tools-10.3.10-12406962.orig/lib/include/guest_os.h open-vm-tools-10.3.10-12406962/lib/include/guest_os.h 2 | --- open-vm-tools-10.3.10-12406962.orig/lib/include/guest_os.h 2019-02-20 02:17:51.000000000 -0800 3 | +++ open-vm-tools-10.3.10-12406962/lib/include/guest_os.h 2019-04-25 08:17:03.678182914 -0700 4 | @@ -249,6 +249,7 @@ 5 | #define STR_OS_DEBIAN_8 "debian8" 6 | #define STR_OS_DEBIAN_9 "debian9" 7 | #define STR_OS_DEBIAN_10 "debian10" 8 | +#define STR_OS_ESOS "ESOS" 9 | #define STR_OS_FEDORA "Fedora" 10 | #define STR_OS_GENTOO "Gentoo" 11 | #define STR_OS_IMMUNIX "Immunix" 12 | diff -Naur open-vm-tools-10.3.10-12406962.orig/lib/misc/hostinfoPosix.c open-vm-tools-10.3.10-12406962/lib/misc/hostinfoPosix.c 13 | --- open-vm-tools-10.3.10-12406962.orig/lib/misc/hostinfoPosix.c 2019-02-20 02:17:24.000000000 -0800 14 | +++ open-vm-tools-10.3.10-12406962/lib/misc/hostinfoPosix.c 2019-04-25 08:19:32.084174904 -0700 15 | @@ -188,6 +188,7 @@ 16 | {"Conectiva", "/etc/conectiva-release"}, 17 | {"Debian", "/etc/debian_release"}, 18 | {"Debian", "/etc/debian_version"}, 19 | + {"ESOS", "/etc/esos-release"}, 20 | {"Fedora Core", "/etc/fedora-release"}, 21 | {"Gentoo", "/etc/gentoo-release"}, 22 | {"Immunix", "/etc/immunix-release"}, 23 | @@ -835,6 +836,8 @@ 24 | } else { 25 | Str_Strcpy(distroShort, STR_OS_ORACLE, distroShortSize); 26 | } 27 | + } else if (strstr(distroLower, "esos")) { 28 | + Str_Strcpy(distroShort, STR_OS_ESOS, distroShortSize); 29 | } else if (strstr(distroLower, "fedora")) { 30 | Str_Strcpy(distroShort, STR_OS_FEDORA, distroShortSize); 31 | } else if (strstr(distroLower, "gentoo")) { 32 | -------------------------------------------------------------------------------- /misc/openssl-1.1.1w.patch: -------------------------------------------------------------------------------- 1 | --- a/apps/CA.pl.in 2018-09-11 14:48:19.000000000 +0200 2 | +++ b/apps/CA.pl.in 2018-09-11 16:16:32.125629435 +0200 3 | @@ -33,7 +33,7 @@ 4 | my $PKCS12 = "$openssl pkcs12"; 5 | 6 | # default openssl.cnf file has setup as per the following 7 | -my $CATOP = "./demoCA"; 8 | +my $CATOP = "/etc/ssl"; 9 | my $CAKEY = "cakey.pem"; 10 | my $CAREQ = "careq.pem"; 11 | my $CACERT = "cacert.pem"; 12 | --- a/apps/openssl.cnf 2018-09-11 14:48:20.000000000 +0200 13 | +++ b/apps/openssl.cnf 2018-09-11 16:16:32.125629435 +0200 14 | @@ -43,7 +43,7 @@ 15 | #################################################################### 16 | [ CA_default ] 17 | 18 | -dir = ./demoCA # Where everything is kept 19 | +dir = /etc/ssl # Where everything is kept 20 | certs = $dir/certs # Where the issued certs are kept 21 | crl_dir = $dir/crl # Where the issued crl are kept 22 | database = $dir/index.txt # database index file. 23 | @@ -327,7 +327,7 @@ 24 | [ tsa_config1 ] 25 | 26 | # These are used by the TSA reply generation only. 27 | -dir = ./demoCA # TSA root directory 28 | +dir = /etc/ssl # TSA root directory 29 | serial = $dir/tsaserial # The current serial number (mandatory) 30 | crypto_device = builtin # OpenSSL engine to use for signing 31 | signer_cert = $dir/tsacert.pem # The TSA signing certificate 32 | -------------------------------------------------------------------------------- /misc/qemu-5.2.0.patch: -------------------------------------------------------------------------------- 1 | --- a/meson.build 2020-12-08 11:59:44.000000000 -0500 2 | +++ b/meson.build 2020-12-22 23:47:41.390961616 -0500 3 | @@ -108,8 +108,7 @@ 4 | native: false, language: ['c', 'cpp', 'objc']) 5 | 6 | if targetos == 'linux' 7 | - add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers', 8 | - '-isystem', 'linux-headers', 9 | + add_project_arguments('-I' + meson.current_source_dir() + '/linux-headers', 10 | language: ['c', 'cpp']) 11 | endif 12 | 13 | @@ -1738,9 +1737,6 @@ 14 | 15 | config_target += config_host 16 | target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])] 17 | - if targetos == 'linux' 18 | - target_inc += include_directories('linux-headers', is_system: true) 19 | - endif 20 | if target.endswith('-softmmu') 21 | qemu_target_name = 'qemu-system-' + target_name 22 | target_type='system' 23 | --- a/target/i386/kvm.c 2020-12-23 00:57:42.520236580 -0500 24 | +++ b/target/i386/kvm.c 2020-12-23 01:15:39.823170130 -0500 25 | @@ -18,6 +18,7 @@ 26 | #include 27 | #include 28 | 29 | +#include 30 | #include 31 | #include "standard-headers/asm-x86/kvm_para.h" 32 | 33 | --- a/target/i386/machine.c 2020-12-23 09:55:42.148502022 -0500 34 | +++ b/target/i386/machine.c 2020-12-23 01:17:10.288755291 -0500 35 | @@ -1,3 +1,4 @@ 36 | +#include 37 | #include "qemu/osdep.h" 38 | #include "cpu.h" 39 | #include "exec/exec-all.h" 40 | -------------------------------------------------------------------------------- /misc/sbd-1.4.1.patch: -------------------------------------------------------------------------------- 1 | --- a/src/sbd-md.c 2019-11-19 12:47:26.000000000 -0500 2 | +++ b/src/sbd-md.c 2021-09-17 08:47:34.975794848 -0400 3 | @@ -891,8 +891,13 @@ 4 | if (quorum_write(successful_delivery)) { 5 | cl_log(LOG_INFO, "Message successfully delivered."); 6 | return 0; 7 | + } else if (successful_delivery) { 8 | + cl_log(LOG_WARNING, "Message only delivered to %d devices, " 9 | + "not a quorum write (half of devices)!", 10 | + successful_delivery); 11 | + return 0; 12 | } else { 13 | - cl_log(LOG_ERR, "Message is not delivered via more then a half of devices"); 14 | + cl_log(LOG_ERR, "Message is not delivered via any devices!"); 15 | return -1; 16 | } 17 | } 18 | --- a/agent/sbd.in 2019-11-19 12:47:26.000000000 -0500 19 | +++ b/agent/sbd.in 2023-11-23 23:32:08.696725216 -0500 20 | @@ -28,7 +28,15 @@ 21 | fi 22 | fi 23 | 24 | -SBD_DEVS=${sbd_device%;} 25 | +SBD_DEVS="" 26 | +for i in ${sbd_device//;/ }; do 27 | + if [ -b "${i}" ]; then 28 | + SBD_DEVS="${SBD_DEVS}${i};" 29 | + else 30 | + ha_log.sh warn "Block device '${i}' does not exist!" 31 | + fi 32 | +done 33 | +SBD_DEVS=${SBD_DEVS%;} 34 | 35 | sbd_device=${SBD_DEVS//;/ -d } 36 | 37 | -------------------------------------------------------------------------------- /misc/scst-3.7.x_20230120.patch: -------------------------------------------------------------------------------- 1 | --- a/iscsi-scst/kernel/iscsi.c 2021-10-26 09:03:22.000000000 -0400 2 | +++ b/iscsi-scst/kernel/iscsi.c 2022-04-28 09:27:47.533213983 -0400 3 | @@ -2450,8 +2450,14 @@ 4 | req_hdr->cmd_sn)) { 5 | *status = ISCSI_RESPONSE_FUNCTION_COMPLETE; 6 | res = 0; 7 | - } else 8 | - *status = ISCSI_RESPONSE_UNKNOWN_TASK; 9 | + } else { 10 | + PRINT_WARNING("Aborting out-of-window command ref_cmd_sn=%d (cmd_sn - 2048)=%d cmd_sn=%d", 11 | + req_hdr->ref_cmd_sn, 12 | + req_hdr->cmd_sn - 2048, 13 | + req_hdr->cmd_sn); 14 | + *status = ISCSI_RESPONSE_FUNCTION_COMPLETE; 15 | + res = 0; 16 | + } 17 | } 18 | 19 | out: 20 | --- a/scst/src/dev_handlers/scst_vdisk.c 2022-12-22 22:08:08.000000000 -0500 21 | +++ b/scst/src/dev_handlers/scst_vdisk.c 2022-12-23 12:10:03.063079572 -0500 22 | @@ -3407,8 +3407,9 @@ 23 | */ 24 | PRINT_WARNING("Closed FD on exec. Not active ALUA state " 25 | "or not blocked dev before ALUA state change? " 26 | - "(cmd %p, op %s, dev %s)", cmd, cmd->op_name, 27 | - cmd->dev->virt_name); 28 | + "(cmd %p, op %s, dev %s, initiator %s)", cmd, 29 | + cmd->op_name, cmd->dev->virt_name, 30 | + cmd->sess->initiator_name); 31 | scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_no_medium)); 32 | goto err; 33 | } 34 | -------------------------------------------------------------------------------- /misc/scst-3.9.x_20241230.patch: -------------------------------------------------------------------------------- 1 | --- a/iscsi-scst/kernel/iscsi.c 2024-12-28 08:44:09.000000000 -0500 2 | +++ b/iscsi-scst/kernel/iscsi.c 2024-12-30 11:55:10.785995470 -0500 3 | @@ -2395,7 +2395,12 @@ 4 | *status = ISCSI_RESPONSE_FUNCTION_COMPLETE; 5 | res = 0; 6 | } else { 7 | - *status = ISCSI_RESPONSE_UNKNOWN_TASK; 8 | + PRINT_WARNING("Aborting out-of-window command ref_cmd_sn=%d (cmd_sn - 2048)=%d cmd_sn=%d", 9 | + req_hdr->ref_cmd_sn, 10 | + req_hdr->cmd_sn - 2048, 11 | + req_hdr->cmd_sn); 12 | + *status = ISCSI_RESPONSE_FUNCTION_COMPLETE; 13 | + res = 0; 14 | } 15 | } 16 | 17 | --- a/scst/src/dev_handlers/scst_vdisk.c 2024-12-28 08:44:09.000000000 -0500 18 | +++ b/scst/src/dev_handlers/scst_vdisk.c 2024-12-30 11:58:58.458261219 -0500 19 | @@ -3353,8 +3353,8 @@ 20 | * "DRBD and other replication/failover SW 21 | * compatibility" section in SCST README. 22 | */ 23 | - PRINT_WARNING("Closed FD on exec. Not active ALUA state or not blocked dev before ALUA state change? (cmd %p, op %s, dev %s)", 24 | - cmd, cmd->op_name, cmd->dev->virt_name); 25 | + PRINT_WARNING("Closed FD on exec. Not active ALUA state or not blocked dev before ALUA state change? (cmd %p, op %s, dev %s, initiator %s)", 26 | + cmd, cmd->op_name, cmd->dev->virt_name, cmd->sess->initiator_name); 27 | scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_no_medium)); 28 | goto err; 29 | } 30 | --- a/scst/include/backport.h 2024-12-28 08:44:09.000000000 -0500 31 | +++ b/scst/include/backport.h 2025-01-02 09:16:44.365918033 -0500 32 | @@ -265,8 +265,10 @@ 33 | * See also commit 2736e8eeb0cc ("block: use the holder as 34 | * indication for exclusive opens") # v6.5. 35 | */ 36 | +#if 0 37 | if (holder) 38 | mode |= BLK_OPEN_EXCL; 39 | +#endif 40 | 41 | return blkdev_get_by_path(path, mode, holder); 42 | } 43 | @@ -281,7 +281,10 @@ 44 | */ 45 | static inline void blkdev_put_backport(struct block_device *bdev, void *holder) 46 | { 47 | +#if 0 48 | blkdev_put(bdev, holder ? BLK_OPEN_EXCL : 0); 49 | +#endif 50 | + blkdev_put(bdev, 0); 51 | } 52 | 53 | #define blkdev_put blkdev_put_backport 54 | -------------------------------------------------------------------------------- /misc/sg3_utils-1.45.patch: -------------------------------------------------------------------------------- 1 | --- a/scripts/rescan-scsi-bus.sh 2019-09-17 17:53:05.000000000 -0400 2 | +++ b/scripts/rescan-scsi-bus.sh 2021-11-21 00:05:28.289350779 -0500 3 | @@ -272,7 +272,7 @@ 4 | RC=$? 5 | 6 | # Handle in progress of becoming ready and unit attention 7 | - while [ $RC = 2 -o $RC = 6 ] && [ $ctr -le 30 ] ; do 8 | + while [ $RC = 2 -o $RC = 6 ] && [ $ctr -le $online_wait ] ; do 9 | if [ $RC = 2 ] && [ "$RMB" != "1" ] ; then 10 | echo -n "." 11 | let LN+=1 12 | @@ -1143,6 +1143,7 @@ 13 | echo "--multipath: same as -m" 14 | echo "--nooptscan: don't stop looking for LUNs if 0 is not found" 15 | echo "--remove: same as -r" 16 | + echo "--online-wait=SECS: wait SECS seconds in online test [default: 30]" 17 | echo "--reportlun2: Tell kernel to try REPORT_LUN even on SCSI2 devices" 18 | echo "--resize: same as -s" 19 | echo "--sparselun: Tell kernel to support sparse LUN numbering" 20 | @@ -1198,6 +1199,7 @@ 21 | filter_ids=0 22 | opt_channelsearch= 23 | remove= 24 | +online_wait=30 25 | updated=0 26 | update=0 27 | resize=0 28 | @@ -1246,6 +1248,7 @@ 29 | -nooptscan) optscan=0 ;; 30 | -nosync) sync=0 ;; 31 | -remove) remove=1 ;; 32 | + -online-wait=*) online_wait=${opt#-online-wait=};; 33 | -reportlun2) scan_flags=$((scan_flags|0x20000)) ;; 34 | -resize) resize=1;; 35 | -sparselun) scan_flags=$((scan_flags|0x40)) ;; 36 | -------------------------------------------------------------------------------- /misc/switchtec-user-3.0.patch: -------------------------------------------------------------------------------- 1 | --- switchtec-user-3.0.orig/lib/pmon.c 2021-09-16 16:16:31.000000000 -0400 2 | +++ switchtec-user-3.0/lib/pmon.c 2022-08-01 08:50:29.000000000 -0400 3 | @@ -445,8 +445,8 @@ 4 | 5 | ret = switchtec_cmd(dev, MRPC_PMON, &cmd, cmd_size, res, 6 | sizeof(*res) * cmd.count); 7 | - if (ret) 8 | - return -1; 9 | + /* if (ret) 10 | + return -1; */ 11 | 12 | remain -= cmd.count; 13 | phys_port_ids += cmd.count; 14 | diff -ru switchtec-user-3.0.orig/lib/switchtec.c switchtec-user-3.0/lib/switchtec.c 15 | --- switchtec-user-3.0.orig/lib/switchtec.c 2021-09-16 16:16:31.000000000 -0400 16 | +++ switchtec-user-3.0/lib/switchtec.c 2022-08-01 08:48:38.000000000 -0400 17 | @@ -448,11 +448,14 @@ 18 | 19 | static void generate_lane_str(struct switchtec_status *s) 20 | { 21 | - int i, l; 22 | + int i, l, w; 23 | 24 | - for (i = 0; i < s->cfg_lnk_width; i++) 25 | - s->lanes[i] = 'x'; 26 | 27 | + w = s->cfg_lnk_width; 28 | + if (w > 16) 29 | + w = 16; 30 | + for (i = 0; i < w; i++) 31 | + s->lanes[i] = 'x'; 32 | if (!s->link_up) 33 | return; 34 | 35 | @@ -461,7 +464,7 @@ 36 | l += s->neg_lnk_width - 1; 37 | 38 | for (i = 0; i < s->neg_lnk_width; i++) { 39 | - if (l < 0) 40 | + if (l < 0 || l > 16) 41 | break; 42 | 43 | if (i < 10) 44 | -------------------------------------------------------------------------------- /misc/sysvinit-2.94.patch: -------------------------------------------------------------------------------- 1 | Submitted By: Bruce Dubbs 2 | Date: 2018-03-30 3 | Initial Package Version: 2.89 4 | Upstream Status: Not Submitted 5 | Origin: Self 6 | Description: Remove programs superceeded by other packages: wall, mountpoint, 7 | last, lastb, mesg, sulogin, and utmpdump. 8 | 9 | Rediffed for vsrsion 2.94. 10 | Remove logsave also. 11 | 12 | --- sysvinit-2.94/src/Makefile.orig 2019-03-07 22:47:42.220455043 -0600 13 | +++ sysvinit-2.94/src/Makefile 2019-03-07 22:48:45.925130823 -0600 14 | @@ -23,19 +23,22 @@ 15 | 16 | # For some known distributions we do not build all programs, otherwise we do. 17 | BIN = 18 | -SBIN = init halt shutdown runlevel killall5 fstab-decode logsave 19 | -USRBIN = last mesg readbootlog 20 | +SBIN = init halt shutdown runlevel killall5 fstab-decode 21 | +#USRBIN = last mesg readbootlog 22 | 23 | -MAN1 = last.1 lastb.1 mesg.1 readbootlog.1 24 | +#MAN1 = last.1 lastb.1 mesg.1 readbootlog.1 25 | MAN5 = initscript.5 inittab.5 initctl.5 26 | -MAN8 = halt.8 init.8 killall5.8 pidof.8 poweroff.8 reboot.8 runlevel.8 27 | -MAN8 += shutdown.8 telinit.8 fstab-decode.8 logsave.8 28 | +#MAN8 = halt.8 init.8 killall5.8 pidof.8 poweroff.8 reboot.8 runlevel.8 29 | +MAN8 = halt.8 init.8 killall5.8 poweroff.8 reboot.8 runlevel.8 30 | +MAN8 += shutdown.8 telinit.8 fstab-decode.8 31 | 32 | ifeq ($(DISTRO),) 33 | -SBIN += sulogin bootlogd 34 | -USRBIN += utmpdump wall 35 | -MAN1 += utmpdump.1 wall.1 36 | -MAN8 += sulogin.8 bootlogd.8 37 | +#SBIN += sulogin bootlogd 38 | +SBIN += bootlogd 39 | +#USRBIN += utmpdump wall 40 | +#MAN1 += utmpdump.1 wall.1 41 | +#MAN8 += sulogin.8 bootlogd.8 42 | +MAN8 += bootlogd.8 43 | endif 44 | 45 | ifeq ($(DISTRO),Debian) 46 | @@ -206,10 +209,10 @@ 47 | ln -sf halt $(ROOT)/sbin/reboot 48 | ln -sf halt $(ROOT)/sbin/poweroff 49 | ln -sf init $(ROOT)/sbin/telinit 50 | - ln -sf /sbin/killall5 $(ROOT)/bin/pidof 51 | - if [ ! -f $(ROOT)/usr/bin/lastb ]; then \ 52 | - ln -sf last $(ROOT)/usr/bin/lastb; \ 53 | - fi 54 | + #ln -sf /sbin/killall5 $(ROOT)/bin/pidof 55 | + #if [ ! -f $(ROOT)/usr/bin/lastb ]; then \ 56 | + # ln -sf last $(ROOT)/usr/bin/lastb; \ 57 | + #fi 58 | $(INSTALL_DIR) $(ROOT)/usr/include/ 59 | $(INSTALL_DATA) initreq.h $(ROOT)/usr/include/ 60 | $(INSTALL_DIR) $(ROOT)$(MANDIR)/man1/ 61 | @@ -231,8 +234,8 @@ 62 | # 63 | # This part is skipped on Debian systems, the 64 | # debian.preinst script takes care of it. 65 | - @if [ ! -p /run/initctl ]; then \ 66 | - echo "Creating /run/initctl"; \ 67 | - rm -f /run/initctl; \ 68 | - mknod -m 600 /run/initctl p; fi 69 | + #@if [ ! -p /run/initctl ]; then \ 70 | + #echo "Creating /run/initctl"; \ 71 | + #rm -f /run/initctl; \ 72 | + #mknod -m 600 /run/initctl p; fi 73 | endif 74 | -------------------------------------------------------------------------------- /pkg_update.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This simple script is used to mass-update all package distribution files (eg, 4 | # tarballs). It is intended to be used only by ESOS developers, and will not 5 | # update any software on a running ESOS system. The script takes two arguments, 6 | # the first is the data file, and the second is the directory containing all 7 | # of the new package files. 8 | 9 | # The data file contains two columns delimited by a single space character. The 10 | # first column contains the old/current file name (eg, lzo-2.06.tar.gz) and the # second column contains the new package file name (eg, lzo-2.09.tar.gz). 11 | 12 | 13 | # Make sure we got what we need 14 | if [ ${#} -ne 2 ]; then 15 | echo "This script takes two arguments:" 16 | echo "PKG_DATA_FILE PATH_TO_NEW_FILES" 17 | exit 1 18 | fi 19 | 20 | # Loop over the package data file 21 | while read line; do 22 | old_pkg=$(echo ${line} | cut -d' ' -f1) 23 | new_pkg=$(echo ${line} | cut -d' ' -f2) 24 | # Check that we actually have something to do 25 | if [ "x${old_pkg}" = "x${new_pkg}" ] || [ "x${new_pkg}" = "xNONE" ] || 26 | [ -z "${old_pkg}" ] || [ -z "${new_pkg}" ]; then 27 | echo "Skipping '${line}'..." 28 | continue 29 | fi 30 | # Get the checksum values for the new files 31 | cd ${2} || exit 1 32 | md5_line=$(md5sum ${new_pkg}) || exit 1 33 | sha256_line=$(sha256sum ${new_pkg}) || exit 1 34 | cd - > /dev/null 35 | # Replace the old checksum lines with the new 36 | sed -i "/${old_pkg}/c\\${md5_line}" ./CHECKSUM.MD5 || exit 1 37 | sed -i "/${old_pkg}/c\\${sha256_line}" ./CHECKSUM.SHA256 || exit 1 38 | # Do the Makefile.in file too 39 | sed -i "s/${old_pkg}/${new_pkg}/" ./Makefile.in || exit 1 40 | done < ${1} 41 | 42 | -------------------------------------------------------------------------------- /scripts/archive_logs.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Dump logs files to the ESOS USB device (esos_logs). Check for free space on 4 | # the esos_logs file system, and if needed, delete log archives starting with 5 | # oldest until we have enough free space. 6 | 7 | # Settings 8 | LOGS_MNT="/mnt/logs" 9 | LOG_DIR="/var/log" 10 | TMP_DIR="/tmp" 11 | NO_MV_FILES="boot pacemaker.log abyss.log node_exporter.log \ 12 | libvirtd_exporter.log prometheus.log" 13 | 14 | # Don't leave anything behind 15 | function cleanup { 16 | if [ -n "${archive_prefix}" ]; then 17 | rm -rf "${TMP_DIR:?}/${archive_prefix}" 18 | fi 19 | if [ -n "${new_arch_tarball}" ]; then 20 | rm -rf "${new_arch_tarball}" 21 | fi 22 | } 23 | trap cleanup INT TERM QUIT EXIT 24 | 25 | # Make sure we always unmount (or try to) 26 | function unmount_fs { 27 | umount "${LOGS_MNT}" || exit 1 28 | } 29 | if ! grep -q esos_persist /proc/cmdline; then 30 | trap unmount_fs EXIT 31 | fi 32 | 33 | # Check free space; this is in KiB (1 KiB blocks), not kilobytes 34 | check_free() { 35 | avail_space="$(df -k "${LOGS_MNT}" | grep -v '^Filesystem' | \ 36 | awk '{print $4}')" 37 | # Reserve 128 MiB so things aren't too tight 38 | avail_space=$((avail_space - 131072)) 39 | echo -n "${avail_space}" 40 | } 41 | 42 | # Mount the file system and set a file prefix 43 | if awk '{print $2}' /proc/mounts | grep -q "${LOGS_MNT}"; then 44 | if ! grep -q esos_persist /proc/cmdline; then 45 | logger -s -t "$(basename "${0}")" -p "local4.warn" \ 46 | "It appears '${LOGS_MNT}' is already mounted! Continuing anyway..." 47 | fi 48 | else 49 | mount "${LOGS_MNT}" || exit 1 50 | fi 51 | archive_prefix="$(hostname)_$(date +%F)_$(date +%s)" 52 | 53 | # Archive the logs -- we should only fail if there is no room in /tmp (tmpfs) 54 | # shellcheck disable=SC2174 55 | mkdir -m 0755 -p "${TMP_DIR}/${archive_prefix}" || exit 1 56 | ignore_files="" 57 | for i in ${NO_MV_FILES}; do 58 | # shellcheck disable=SC2125 59 | ignore_files="${ignore_files} ! -path "*/${i}"" 60 | done 61 | # shellcheck disable=SC2086 62 | while read -r i; do 63 | [[ -n "${i}" ]] || break 64 | base_dir="$(dirname "${i}")" 65 | base_dir="${base_dir//"${LOG_DIR}"/}" 66 | mkdir -p "${TMP_DIR}/${archive_prefix}/${base_dir}" || exit 1 67 | mv -f "${i}" "${TMP_DIR}/${archive_prefix}/${base_dir}/" || exit 1 68 | done <<< "$(find ${LOG_DIR} -type f ${ignore_files})" 69 | for i in ${NO_MV_FILES}; do 70 | # TODO: Need a better solution, we're losing log lines using cp + truncate! 71 | file_path="${LOG_DIR}/${i}" 72 | if [ -f "${file_path}" ]; then 73 | base_dir="$(dirname "${file_path}")" 74 | base_dir="${base_dir//"${LOG_DIR}"/}" 75 | mkdir -p "${TMP_DIR}/${archive_prefix}/${base_dir}" || exit 1 76 | cp -p "${file_path}" "${TMP_DIR}/${archive_prefix}/${base_dir}/" \ 77 | || exit 1 78 | truncate -s 0 "${file_path}" || exit 1 79 | fi 80 | done 81 | new_arch_tarball="${TMP_DIR}/${archive_prefix}.tar.gz" 82 | tar cpfz "${new_arch_tarball}" -C "${TMP_DIR}" "${archive_prefix}" || exit 1 83 | new_arch_size="$(du -k "${new_arch_tarball}" | awk '{print $1}')" 84 | 85 | # Make sure this is even feasible 86 | total_space=$(df -k ${LOGS_MNT} | grep -v '^Filesystem' | awk '{print $2}') 87 | if [ "${new_arch_size}" -gt "${total_space}" ]; then 88 | echo "The new log archive (${new_arch_tarball}) will not fit on" \ 89 | "the ${LOGS_MNT} file system." 1>&2 90 | exit 1 91 | fi 92 | 93 | # Get rid of old files (if needed) until we have enough space free 94 | while [ "${new_arch_size}" -gt "$(check_free)" ]; do 95 | find ${LOGS_MNT} -type f ! -path "${LOGS_MNT}/var_log/*" -print0 | \ 96 | sort -z | xargs -0 ls | head -n 1 | xargs rm 97 | done 98 | 99 | # Move the new archive to USB 100 | mv -f "${new_arch_tarball}" "${LOGS_MNT}/" || exit 1 101 | 102 | # Make syslogd happy again 103 | killall -q -SIGHUP syslogd 104 | 105 | # Re-create some files 106 | touch ${LOG_DIR}/wtmp 107 | touch ${LOG_DIR}/lastlog 108 | 109 | # Done 110 | rm -rf "${TMP_DIR:?}/${archive_prefix}" 111 | 112 | -------------------------------------------------------------------------------- /scripts/backup_conf.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Use this script to create a full backup/archive of the entire ESOS 4 | # configuration that resides on the persistent boot media file system 5 | # (LABEL=esos_conf). The archive is created in the /tmp directory and 6 | # the absolute path of the file name is returned. 7 | 8 | RELEASE="$(sed -r "s/ +/-/g" /etc/esos-release)" 9 | HOSTNAME="$(hostname)" 10 | ARCHIVE_NAME="esos_backup_conf-$(date +%s)@${HOSTNAME}@${RELEASE}" 11 | ARCHIVE_DIR="/tmp/${ARCHIVE_NAME}" 12 | ARCHIVE_FILE="${ARCHIVE_DIR}.tgz" 13 | SYNC_LOCK="/var/lock/conf_sync" 14 | CONF_MNT="/mnt/conf" 15 | 16 | # We use a temporary directory while collecting the data 17 | mkdir -p ${ARCHIVE_DIR} || exit 1 18 | 19 | # Sync the config here for good measure 20 | conf_sync.sh || exit 1 21 | 22 | # Prevent conf_sync.sh from running 23 | exec 200> "${SYNC_LOCK}" 24 | flock --timeout 300 -E 200 -x 200 25 | RC=${?} 26 | if [ ${RC} -ne 0 ]; then 27 | echo "ERROR: Could not acquire conf_sync lock (RC=${RC})," \ 28 | "so we're not backing up!" 1>&2 29 | exit ${RC} 30 | fi 31 | 32 | if ! grep -q esos_persist /proc/cmdline; then 33 | # Mount the ESOS config FS 34 | mount ${CONF_MNT} || exit 1 35 | fi 36 | 37 | # Grab all items from the config - exclude stuff under /opt 38 | rsync -aq ${CONF_MNT}/* --exclude=rsync_dirs/opt ${ARCHIVE_DIR} || exit 1 39 | 40 | # Make the tarball 41 | tar cpfz ${ARCHIVE_FILE} --transform 's,^tmp/,,' \ 42 | ${ARCHIVE_DIR} 2> /dev/null || exit 1 43 | 44 | # All done 45 | if ! grep -q esos_persist /proc/cmdline; then 46 | umount ${CONF_MNT} || exit 1 47 | fi 48 | rm -rf ${ARCHIVE_DIR} || exit 1 49 | echo "${ARCHIVE_FILE}" 50 | -------------------------------------------------------------------------------- /scripts/cluster_start.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Start cluster services (if not already started) in the proper sequence. If 4 | # SBD is enabled, we attempt to start that first. 5 | 6 | source /etc/rc.d/common 7 | 8 | if check_enabled "rc.sbd"; then 9 | if ! /etc/rc.d/rc.sbd status; then 10 | /etc/rc.d/rc.sbd start 11 | fi 12 | fi 13 | if ! /etc/rc.d/rc.corosync status; then 14 | /etc/rc.d/rc.corosync start 15 | fi 16 | if ! /etc/rc.d/rc.pacemaker status; then 17 | /etc/rc.d/rc.pacemaker start 18 | fi 19 | 20 | -------------------------------------------------------------------------------- /scripts/cluster_stop.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Stop cluster services (if not already stopped) in the proper sequence. If 4 | # SBD is enabled, we attempt to stop that last. 5 | 6 | source /etc/rc.d/common 7 | 8 | if /etc/rc.d/rc.pacemaker status; then 9 | /etc/rc.d/rc.pacemaker stop 10 | fi 11 | if /etc/rc.d/rc.corosync status; then 12 | /etc/rc.d/rc.corosync stop 13 | fi 14 | if check_enabled "rc.sbd"; then 15 | if /etc/rc.d/rc.sbd status; then 16 | /etc/rc.d/rc.sbd stop 17 | fi 18 | fi 19 | 20 | -------------------------------------------------------------------------------- /scripts/conf_sync.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Try to acquire exclusive lock for up to 5 minutes (5 * 60 = 300 seconds) 4 | SYNC_LOCK="/var/lock/conf_sync" 5 | exec 200> "${SYNC_LOCK}" 6 | flock --timeout 300 -E 200 -x 200 7 | RC=${?} 8 | if [ ${RC} -eq 200 ]; then 9 | echo "ERROR: Could not acquire lock file with-in 5 minutes," \ 10 | "so we're not sync'ing!" 1>&2 11 | exit ${RC} 12 | elif [ ${RC} -ne 0 ]; then 13 | echo "ERROR: Could not acquire lock, so we're not sync'ing!" 1>&2 14 | exit ${RC} 15 | fi 16 | 17 | # Commit any changed files to the local Git repo 18 | cd /etc && /usr/bin/git add -A || exit 1 19 | cd /etc && /usr/bin/git diff-index --quiet HEAD || \ 20 | /usr/bin/git commit -q -m "configuration sync via conf_sync.sh" || exit 1 21 | # Synchronize the local configuration with the USB flash drive 22 | /usr/local/sbin/usb_sync.sh || exit 1 23 | 24 | -------------------------------------------------------------------------------- /scripts/crm_mon_email.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This is a helper script intended to be used with the ClusterMon RA. It 4 | # uses environment variables from the crm_mon binary; the original script is 5 | # based on this SNMP helper script from Florian Crouzat: 6 | # https://github.com/ClusterLabs/pacemaker/blob/master/extra/pcmk_snmp_helper.sh 7 | # 8 | # Example resource agent (ocf:pacemaker:ClusterMon) configuration: 9 | # primitive p_notify ocf:pacemaker:ClusterMon \ 10 | # params user="root" update="30" \ 11 | # extra_options="-E /usr/local/bin/crm_mon_email.sh -e root" \ 12 | # op monitor on-fail="restart" interval="10" 13 | # clone clone_notify p_notify \ 14 | # meta target-role="Started" 15 | 16 | # Test for a failed monitor operation, or anything that isn't monitor 17 | if [ "x${CRM_notify_rc}" != "x0" -a "x${CRM_notify_task}" = "xmonitor" ] || \ 18 | [ "x${CRM_notify_task}" != "xmonitor" ] && \ 19 | [ -n "${CRM_notify_recipient}" ]; then 20 | # Send a notification email 21 | sendmail -t <<-EOF 22 | To: ${CRM_notify_recipient} 23 | From: root 24 | Subject: ESOS Cluster Status Change - `hostname` (`date`) 25 | 26 | CRM_notify_node: ${CRM_notify_node} 27 | CRM_notify_rsc: ${CRM_notify_rsc} 28 | CRM_notify_task: ${CRM_notify_task} 29 | CRM_notify_desc: ${CRM_notify_desc} 30 | CRM_notify_rc: ${CRM_notify_rc} 31 | CRM_notify_target_rc: ${CRM_notify_target_rc} 32 | CRM_notify_status: ${CRM_notify_status} 33 | EOF 34 | fi 35 | 36 | -------------------------------------------------------------------------------- /scripts/pwatcher.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # shellcheck disable=SC1091 4 | source /etc/rc.d/common 5 | 6 | WATCHER_LOG="/var/log/pwatcher.log" 7 | WATCH_PROCESS_ARGS="" 8 | 9 | log_it() { 10 | echo "$(date "+%F %T %Z") ${*}" >> "${WATCHER_LOG}" 11 | } 12 | 13 | start() { 14 | log_it "Starting '${WATCH_PROCESS}'..." 15 | log_it "STATUS_TEST='${STATUS_TEST}'" 16 | log_it "LOCK_FILE='${LOCK_FILE}'" 17 | log_it "WATCH_PROCESS='${WATCH_PROCESS}'" 18 | log_it "WATCH_PROCESS_ARGS='${WATCH_PROCESS_ARGS}'" 19 | # shellcheck disable=SC2086 20 | ${WATCH_PROCESS} ${WATCH_PROCESS_ARGS} > /dev/null 2>&1 & 21 | touch "${LOCK_FILE}" 22 | } 23 | 24 | stop() { 25 | log_it "Stopping '${WATCH_PROCESS}'..." 26 | watch_pid=$(pidof -x "${WATCH_PROCESS}") 27 | if [ -n "${watch_pid}" ]; then 28 | log_it "Sending TERM signal to PID '${watch_pid}'..." 29 | kill -TERM "${watch_pid}" || exit 1 30 | if ! wait_for_stop "${WATCH_PROCESS}" 30; then 31 | log_it "TERM didn't seem to stop the process;" \ 32 | "sending ABRT signal to PID '${watch_pid}'..." 33 | kill -ABRT "${watch_pid}" || exit 1 34 | if ! wait_for_stop "${WATCH_PROCESS}" 20; then 35 | log_it "ABRT didn't seem to stop the process;" \ 36 | "sending KILL signal to PID '${watch_pid}'..." 37 | kill -KILL "${watch_pid}" || exit 1 38 | if ! wait_for_stop "${WATCH_PROCESS}" 10; then 39 | log_it "KILL didn't seem to stop the process;" \ 40 | "we're giving up and exiting now..." 41 | exit 1 42 | fi 43 | fi 44 | fi 45 | fi 46 | } 47 | 48 | status() { 49 | # Check for either a matching running daemon process or a subprocess 50 | # running the process 51 | pidof "${WATCH_PROCESS}" > /dev/null 2>&1 52 | rc=${?} 53 | pidof -x "${WATCH_PROCESS}" > /dev/null 2>&1 54 | rc2=${?} 55 | if [ ${rc} -ne 0 ] && [ ${rc2} -ne 0 ]; then 56 | # Only log the message if we have a lock file 57 | if [ -e "${LOCK_FILE}" ]; then 58 | log_it "No PID detected for the '${WATCH_PROCESS}' process!" \ 59 | "It must have died unexpectedly..." 60 | fi 61 | return 1 62 | elif [ -n "${STATUS_TEST}" ]; then 63 | if ! eval "${STATUS_TEST}"; then 64 | log_it "The additional status test '${STATUS_TEST}' exited" \ 65 | "non-zero for the '${WATCH_PROCESS}' process!" \ 66 | "Attempting to stop it now..." 67 | stop 68 | return 1 69 | fi 70 | else 71 | return 0 72 | fi 73 | } 74 | 75 | # Stop the process that this watcher started on exit 76 | trap "stop; exit" INT TERM QUIT 77 | 78 | # Parse the arguments 79 | STATUS_TEST="${1}" 80 | shift 81 | LOCK_FILE="${1}" 82 | shift 83 | WATCH_PROCESS="${1}" 84 | shift 85 | if [ -z "${LOCK_FILE}" ] || [ -z "${WATCH_PROCESS}" ]; then 86 | echo "Usage: ${0} STATUS_TEST LOCK_FILE PROCESS_NAME [PROCESS_ARGS]" 87 | exit 1 88 | fi 89 | # shellcheck disable=SC2124 90 | WATCH_PROCESS_ARGS="${@}" 91 | 92 | # Look at all pwatcher processes and see if we have one already 93 | # running for the requested WATCH_PROCESS 94 | existing_pids="$(pidof -x -o %PPID "${0}")" 95 | if [ "$(wc -w <<< "${existing_pids}")" -ge 1 ]; then 96 | for existing_pid in ${existing_pids}; do 97 | if grep -q "${WATCH_PROCESS}" "/proc/${existing_pid}/cmdline"; then 98 | echo "An existing process watcher running for '${WATCH_PROCESS}'" \ 99 | "was detected, exiting..." 100 | exit 0 101 | fi 102 | done 103 | fi 104 | 105 | # We loop here indefinitely, monitoring the watched process 106 | while true; do 107 | if ! status; then 108 | log_it "The '${WATCH_PROCESS}' process is not running," \ 109 | "attempting to start it..." 110 | sleep 10 111 | start 112 | sleep 15 113 | else 114 | sleep 15 115 | fi 116 | done 117 | 118 | -------------------------------------------------------------------------------- /scripts/sbd_list.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # A simple utility script which reads the SBD configuration file and loops 4 | # through all SBD block devices, listing (printing) all allocated slots and 5 | # messages for each. 6 | 7 | SBD_CONFIG="/etc/sysconfig/sbd" 8 | 9 | # Read the SBD config file and loop over all devices 10 | while read -r device; do 11 | echo "Device '${device}':" 12 | sbd -d ${device} list 13 | echo 14 | done <<< "$(cat ${SBD_CONFIG} | grep SBD_DEVICE | cut -d= -f2 | \ 15 | tr -d '"' | tr ';' '\n')" 16 | 17 | -------------------------------------------------------------------------------- /scripts/sbd_unfence.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # A simple utility script which reads the SBD configuration file and loops 4 | # through all SBD block devices, clearing message slots for all nodes. This 5 | # effectively unfences any nodes. 6 | 7 | SBD_CONFIG="/etc/sysconfig/sbd" 8 | 9 | # Read the SBD config file and loop over all devices 10 | while read -r device; do 11 | while read -r sbd_list; do 12 | node="$(echo ${sbd_list} | awk '{print $2}')" 13 | echo "Clearing message slots for node '${node}'" \ 14 | "on device '${device}'..." 15 | sbd -d ${device} message ${node} clear 16 | done <<< "$(sbd -d ${device} list)" 17 | done <<< "$(cat ${SBD_CONFIG} | grep SBD_DEVICE | cut -d= -f2 | \ 18 | tr -d '"' | tr ';' '\n')" 19 | 20 | -------------------------------------------------------------------------------- /scripts/startup.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # System startup script; this script will check for crash dump files, grab some 4 | # information from the ESOS system, and then emails the root user everything. 5 | 6 | EMAIL_TO="root" 7 | EMAIL_FROM="root" 8 | LOGS_MNT="/mnt/logs" 9 | 10 | if grep -q esos_iso /proc/cmdline; then 11 | # Don't do anything if we're booted off a CD-ROM / ISO 12 | exit 0 13 | fi 14 | 15 | # Check for kernel crash dump files on the esos_logs filesystem 16 | if ! grep -q esos_persist /proc/cmdline; then 17 | mount ${LOGS_MNT} 18 | fi 19 | if ls ${LOGS_MNT}/*dumpfile* > /dev/null 2>&1; then 20 | dump_files="" 21 | for i in $(ls ${LOGS_MNT}/*dumpfile*); do 22 | dump_files="${dump_files}${i}\n" 23 | done 24 | fi 25 | if ! grep -q esos_persist /proc/cmdline; then 26 | umount ${LOGS_MNT} 27 | fi 28 | 29 | # Send the email message 30 | sendmail -t << _EOF_ 31 | To: ${EMAIL_TO} 32 | From: ${EMAIL_FROM} 33 | Subject: System Startup - $(hostname) ($(date)) 34 | $(cat /etc/esos-release) on host "$(hostname)" has started. If this system startup is expected, you can probably ignore this. 35 | 36 | $(test "${dump_files}" != "" && echo "** Warning! Kernel crash dump file(s) detected:"; echo -e "${dump_files}") 37 | 38 | $(test -d "/sys/kernel/scst_tgt" && scstadmin -list_target) 39 | $(test -d "/sys/kernel/scst_tgt" && scstadmin -list_device) 40 | _EOF_ 41 | 42 | -------------------------------------------------------------------------------- /scripts/support_pkg.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This script is responsible for creating a support "bundle" (package/archive) 4 | # from the ESOS server. System logs, kernel messages, configuration files, and 5 | # other data is collected and packaged into an archive file. We attempt to 6 | # avoid capturing sensitive data (eg, /etc/shadow) but care should be taken 7 | # with the contents of the package file. The archive is created in the /tmp 8 | # directory and the absolute path of the file name is returned. 9 | 10 | BUNDLE_NAME="esos_support_pkg-$(date +%s)" 11 | BUNDLE_DIR="/tmp/${BUNDLE_NAME}" 12 | BUNDLE_FILE="${BUNDLE_DIR}.tgz" 13 | 14 | # We use a temporary directory while collecting the data 15 | mkdir -p ${BUNDLE_DIR} || exit 1 16 | 17 | # Get everything we need 18 | rsync -aq /etc ${BUNDLE_DIR} --exclude='rc.d' --exclude='ssh' \ 19 | --exclude='shadow*' --exclude='ssmtp' || exit 1 20 | rsync -aq /var/log ${BUNDLE_DIR} || exit 1 21 | dmesg > ${BUNDLE_DIR}/dmesg.out || exit 1 22 | lsmod > ${BUNDLE_DIR}/lsmod.out || exit 1 23 | ps -aef > ${BUNDLE_DIR}/ps.out || exit 1 24 | uptime > ${BUNDLE_DIR}/uptime.out || exit 1 25 | last > ${BUNDLE_DIR}/last.out || exit 1 26 | 27 | # Make the tarball 28 | tar cpfz ${BUNDLE_FILE} --transform 's,^tmp/,,' \ 29 | ${BUNDLE_DIR} 2> /dev/null || exit 1 30 | 31 | # All done 32 | rm -rf ${BUNDLE_DIR} || exit 1 33 | echo "${BUNDLE_FILE}" 34 | 35 | -------------------------------------------------------------------------------- /scripts/usb_sync.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This script will synchronize configuration files between the ESOS USB 4 | # device (esos_conf) and the root tmpfs filesystem using Git and rsync. 5 | # The '-i' ('--initial') flag should only be used on boot to perform the 6 | # initial configuration sync (from USB to root tmpfs). 7 | 8 | CONF_MNT="/mnt/conf" 9 | USB_RSYNC="${CONF_MNT}/rsync_dirs" 10 | ETCKEEPER_REPO="${CONF_MNT}/etckeeper.git" 11 | # Absolute paths (leading '/' required) 12 | RSYNC_DIRS="/var/lib /opt /root/.ssh /root/.bash_history" 13 | INITIAL_SYNC=0 14 | ROOT_PATH="/" 15 | 16 | # Make sure we always unmount (or try to) 17 | function unmount_fs { 18 | umount ${CONF_MNT} || exit 1 19 | } 20 | if ! grep -q esos_persist /proc/cmdline; then 21 | trap unmount_fs EXIT 22 | fi 23 | 24 | function initial_rsync { 25 | # Use rsync for the other directories/files 26 | mkdir -p ${USB_RSYNC} || exit 1 27 | rsync --archive --update --exclude "System Volume Information" \ 28 | --exclude "lost+found" ${USB_RSYNC}/ ${ROOT_PATH} || exit 1 29 | } 30 | 31 | # Read the options and extract 32 | TEMP=$(getopt -o i --long initial -n 'usb_sync.sh' -- "$@") 33 | eval set -- "$TEMP" 34 | while true ; do 35 | case "$1" in 36 | -i|--initial) INITIAL_SYNC=1; shift ;; 37 | --) shift; break ;; 38 | *) echo "Error extracting options!"; exit 1 ;; 39 | esac 40 | done 41 | 42 | # Mount, sync, and unmount 43 | if cat /proc/mounts | awk '{print $2}' | grep -q ${CONF_MNT}; then 44 | if ! grep -q esos_persist /proc/cmdline; then 45 | logger -s -t $(basename ${0}) -p "local4.warn" \ 46 | "It appears '${CONF_MNT}' is already mounted! Continuing anyway..." 47 | fi 48 | else 49 | mount ${CONF_MNT} || exit 1 50 | fi 51 | if [ ${INITIAL_SYNC} -eq 1 ]; then 52 | if git ls-remote ${ETCKEEPER_REPO} > /dev/null 2>&1; then 53 | # The Git repo exists, pull it down locally 54 | cd /etc && git init -q || exit 1 55 | cd /etc && git remote add origin ${ETCKEEPER_REPO} || exit 1 56 | cd /etc && git fetch -q origin master || exit 1 57 | cd /etc && git checkout -q -f -b master --track origin/master || exit 1 58 | cd /etc && git reset -q --hard origin/master || exit 1 59 | etckeeper init > /dev/null || exit 1 60 | # Populate the other directories/files 61 | initial_rsync 62 | else 63 | # Migrate any old configuration directories 64 | if [ -d "${CONF_MNT}/etc" ]; then 65 | echo "Sync'ing previous /etc configuration locally..." 66 | rsync --archive --exclude etc/esos-release \ 67 | ${CONF_MNT}/etc ${ROOT_PATH} || exit 1 68 | rm -rf ${CONF_MNT:?}/etc || exit 1 69 | fi 70 | if [ -d "${CONF_MNT}/var" ]; then 71 | echo "Moving USB /var directory to new location..." 72 | mkdir -p ${USB_RSYNC} || exit 1 73 | mv ${CONF_MNT}/var ${USB_RSYNC}/ || exit 1 74 | fi 75 | if [ -d "${CONF_MNT}/opt" ]; then 76 | echo "Moving USB /opt directory to new location..." 77 | mkdir -p ${USB_RSYNC} || exit 1 78 | mv ${CONF_MNT}/opt ${USB_RSYNC}/ || exit 1 79 | fi 80 | # Pull down other directories first as special overrides might exist 81 | initial_rsync 82 | # Initialize and configure the new Git repo 83 | git init -q --bare ${ETCKEEPER_REPO} || exit 1 84 | echo -en "# Specific to ESOS\n/rc.d/\n/esos-release\n/issue\n\n" > \ 85 | /etc/.gitignore || exit 1 86 | git config --system user.name "ESOS Superuser" || exit 1 87 | git config --system user.email "root@esos" || exit 1 88 | etckeeper init > /dev/null || exit 1 89 | cd /etc && git commit -q -m "initial check-in via usb_sync.sh" || exit 1 90 | cd /etc && git remote add origin ${ETCKEEPER_REPO} || exit 1 91 | cd /etc && git push -q origin master || exit 1 92 | fi 93 | else 94 | # During an upgrade, the user may wipe esos_conf, so recreate if needed 95 | if ! git ls-remote ${ETCKEEPER_REPO} > /dev/null 2>&1; then 96 | git init -q --bare ${ETCKEEPER_REPO} || exit 1 97 | fi 98 | if [ ! -d "${USB_RSYNC}" ]; then 99 | mkdir -p ${USB_RSYNC} || exit 1 100 | fi 101 | # Push changes up to the USB Git repo / file system 102 | cd /etc && git push -q origin master || exit 1 103 | rsync-no-vanished --archive --relative --delete \ 104 | ${RSYNC_DIRS} ${USB_RSYNC} || exit 1 105 | fi 106 | 107 | -------------------------------------------------------------------------------- /tui/Makefile: -------------------------------------------------------------------------------- 1 | CC ?= gcc 2 | RM ?= rm 3 | CPPFLAGS := $(CPPFLAGS) 4 | CFLAGS := $(CFLAGS) 5 | LDFLAGS := $(LDFLAGS) 6 | SRC_FILES := $(wildcard *.c) 7 | OBJ_FILES := $(patsubst %.c,%.o,$(SRC_FILES)) 8 | 9 | .PHONY: all 10 | all: esos_tui 11 | 12 | .PHONY: clean 13 | clean: 14 | $(RM) $(OBJ_FILES) 15 | $(RM) esos_tui 16 | 17 | %.o: %.c 18 | $(CC) -m64 -std=gnu99 -Wall -Wextra -pedantic -c -g -O2 \ 19 | $(CPPFLAGS) $(CFLAGS) -D_GNU_SOURCE -o $@ $< 20 | 21 | esos_tui: $(OBJ_FILES) 22 | $(CC) -m64 -std=gnu99 -Wall -Wextra -pedantic $(LDFLAGS) $(OBJ_FILES) \ 23 | -lcdkw -lncursesw -liniparser -lparted -lblkid -luuid -lcurl -lanl -o $@ 24 | 25 | -------------------------------------------------------------------------------- /tui/strings.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file strings.c 3 | * @brief Common string variables used throughout the entire program. 4 | * @author Copyright (c) 2019 Quantum Corporation 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #include "prototypes.h" 11 | 12 | /* Dialog radio widget options */ 13 | char *g_no_yes_opts[] = {"No", "Yes"}, 14 | *g_auth_meth_opts[] = {"None", "Plain Text", "CRAM-MD5"}, 15 | *g_ip_opts[] = {"Disabled", "Static", "DHCP"}, 16 | *g_hw_write_opts[] = {"Write Through", "Write Back"}, 17 | *g_hw_read_opts[] = {"No Read-ahead", "Use Read-ahead"}, 18 | *g_hw_raid_opts[] = {"0", "1", "5", "6"}, 19 | *g_dsbl_enbl_opts[] = {"Disabled (0)", "Enabled (1)"}, 20 | *g_fs_type_opts[] = {"xfs", "btrfs", "ext3", "ext4"}, 21 | *g_md_level_opts[] = {"raid0", "raid1", "raid10", 22 | "raid6", "raid5", "raid4"}, 23 | *g_md_chunk_opts[] = {"8K", "16K", "32K", "64K", "128K", "512K"}; 24 | 25 | /* Misc. widget related strings */ 26 | char *g_choice_char[] = {"[ ] ", "[*] "}, 27 | *g_bonding_map[] = {"None", "Master", "Slave"}, 28 | *g_scst_dev_types[] = {"dev_disk", "dev_disk_perf", 29 | "vcdrom", "vdisk_blockio", "vdisk_fileio", "vdisk_nullio", 30 | "dev_changer", "dev_tape", "dev_tape_perf"}, 31 | *g_scst_bs_list[] = {"512", "1024", "2048", "4096", "8192"}, 32 | *g_fio_types[] = {"File System", "Block Device"}, 33 | *g_sync_label_msg[] = {"", "", 34 | " Synchronizing ESOS configuration... ", "", ""}, 35 | *g_save_label_msg[] = {"", "", 36 | " Writing the SCST configuration... ", "", ""}, 37 | *g_add_ld_label_msg[] = {"", "", 38 | " Adding the new logical drive... ", "", ""}, 39 | *g_add_array_label_msg[] = {"", "", 40 | " Adding the new MD array... ", "", ""}, 41 | *g_add_lv_label_msg[] = {"", "", 42 | " Adding the new LVM LV... ", "", ""}; 43 | 44 | /* Button strings */ 45 | char *g_ok_cancel_msg[] = {" OK ", " Cancel "}, 46 | *g_ok_msg[] = {" OK "}, 47 | *g_yes_no_msg[] = {" Yes ", " No "}; 48 | 49 | /* Other string stuff */ 50 | char *g_transports[] = {"unknown", "scsi", "ide", "dac960", "cpqarray", 51 | "file", "ataraid", "i2o", "ubd", "dasd", "viodasd", "sx8", "dm"}, 52 | *g_scst_handlers[] = {"dev_disk", "dev_disk_perf", "vcdrom", 53 | "vdisk_blockio", "vdisk_fileio", "vdisk_nullio", "dev_changer", 54 | "dev_tape", "dev_tape_perf"}; 55 | 56 | /* Functions to return the sizes */ 57 | size_t g_scst_dev_types_size() { 58 | return (sizeof g_scst_dev_types) / (sizeof g_scst_dev_types[0]); 59 | } 60 | size_t g_scst_handlers_size() { 61 | return (sizeof g_scst_handlers) / (sizeof g_scst_handlers[0]); 62 | } 63 | size_t g_sync_label_msg_size() { 64 | return (sizeof g_sync_label_msg) / (sizeof g_sync_label_msg[0]); 65 | } 66 | size_t g_save_label_msg_size() { 67 | return (sizeof g_save_label_msg) / (sizeof g_save_label_msg[0]); 68 | } 69 | size_t g_add_ld_label_msg_size() { 70 | return (sizeof g_add_ld_label_msg) / (sizeof g_add_ld_label_msg[0]); 71 | } 72 | size_t g_add_array_label_msg_size() { 73 | return (sizeof g_add_array_label_msg) / (sizeof g_add_array_label_msg[0]); 74 | } 75 | size_t g_add_lv_label_msg_size() { 76 | return (sizeof g_add_lv_label_msg) / (sizeof g_add_lv_label_msg[0]); 77 | } 78 | --------------------------------------------------------------------------------