OXIESEC PANEL
- Current Dir:
/
/
sbin
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 07:54:56 AM
rwxr-xr-x
📄
acpi_available
112 bytes
03/01/2018 10:25:41 PM
rwxr-xr-x
📄
agetty
55.23 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
apm_available
81 bytes
03/12/2018 01:00:16 AM
rwxr-xr-x
📄
apparmor_parser
1.41 MB
06/20/2023 11:51:13 PM
rwxr-xr-x
📄
badblocks
26.01 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
blkdeactivate
14.49 KB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
blkdiscard
26.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
blkid
86.11 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
blockdev
38.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
bridge
86.16 KB
01/26/2021 01:33:08 PM
rwxr-xr-x
📄
capsh
17.99 KB
11/16/2017 11:35:52 PM
rwxr-xr-x
📄
cfdisk
94.44 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
cgdisk
182.17 KB
09/20/2017 08:05:45 PM
rwxr-xr-x
📄
chcpu
22.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
cryptdisks_start
1.11 KB
08/03/2020 09:28:48 PM
rwxr-xr-x
📄
cryptdisks_stop
1.16 KB
08/03/2020 09:28:48 PM
rwxr-xr-x
📄
cryptsetup
86.23 KB
08/03/2020 09:28:48 PM
rwxr-xr-x
📄
cryptsetup-reencrypt
80.96 KB
08/03/2020 09:28:48 PM
rwxr-xr-x
📄
ctrlaltdel
18.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
debugfs
217.47 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
depmod
146.18 KB
07/28/2020 02:46:39 PM
rwxr-xr-x
📄
devlink
78.16 KB
01/26/2021 01:33:08 PM
rwxr-xr-x
📄
dhclient
488.42 KB
10/04/2022 01:38:12 PM
rwxr-xr-x
📄
dhclient-script
15.25 KB
10/04/2022 01:38:12 PM
rwxr-xr-x
📄
dmeventd
46.08 KB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
dmsetup
158.8 KB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
dmstats
158.8 KB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
dosfsck
58.08 KB
01/24/2017 11:48:34 PM
rwxr-xr-x
📄
dosfslabel
54.08 KB
01/24/2017 11:48:34 PM
rwxr-xr-x
📄
dumpe2fs
26.08 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
e2fsck
306.72 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
e2image
34.08 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
e2label
102.25 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
e2undo
18.07 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
ebtables
5.99 KB
06/28/2018 04:42:04 PM
rwxr-xr-x
📄
ebtables-restore
9.99 KB
06/28/2018 04:42:04 PM
rwxr-xr-x
📄
ebtables-save
1.63 KB
06/28/2018 04:42:04 PM
rwxr-xr-x
📄
ethtool
338.9 KB
02/23/2018 11:58:14 AM
rwxr-xr-x
📄
fatlabel
54.08 KB
01/24/2017 11:48:34 PM
rwxr-xr-x
📄
fdisk
122.13 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
findfs
10.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
fixparts
62.17 KB
09/20/2017 08:05:45 PM
rwxr-xr-x
📄
fsadm
23.5 KB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
fsck
46.13 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
fsck.cramfs
34.11 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
fsck.ext2
306.72 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
fsck.ext3
306.72 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
fsck.ext4
306.72 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
fsck.fat
58.08 KB
01/24/2017 11:48:34 PM
rwxr-xr-x
📄
fsck.minix
90.1 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
fsck.msdos
58.08 KB
01/24/2017 11:48:34 PM
rwxr-xr-x
📄
fsck.vfat
58.08 KB
01/24/2017 11:48:34 PM
rwxr-xr-x
📄
fsck.xfs
433 bytes
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
fsfreeze
10.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
fstab-decode
5.99 KB
11/01/2017 09:00:29 PM
rwxr-xr-x
📄
fstrim
42.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
gdisk
190.17 KB
09/20/2017 08:05:45 PM
rwxr-xr-x
📄
getcap
9.99 KB
11/16/2017 11:35:52 PM
rwxr-xr-x
📄
getpcaps
9.99 KB
11/16/2017 11:35:52 PM
rwxr-xr-x
📄
getty
55.23 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
halt
178.08 KB
03/02/2023 12:58:02 PM
rwxr-xr-x
📄
hdparm
128.18 KB
02/22/2018 01:51:46 PM
rwxr-xr-x
📄
hwclock
58.19 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
ifconfig
77.11 KB
01/10/2017 04:25:08 AM
rwxr-xr-x
📄
init
1.54 MB
03/02/2023 12:58:02 PM
rwxr-xr-x
📄
insmod
146.18 KB
07/28/2020 02:46:39 PM
rwxr-xr-x
📄
installkernel
2.58 KB
12/30/2017 06:15:02 PM
rwxr-xr-x
📄
integritysetup
39.66 KB
08/03/2020 09:28:48 PM
rwxr-xr-x
📄
ip
545.12 KB
01/26/2021 01:33:08 PM
rwxr-xr-x
📄
ip6tables
92.74 KB
05/09/2023 06:42:18 PM
rwxr-xr-x
📄
ip6tables-restore
92.74 KB
05/09/2023 06:42:18 PM
rwxr-xr-x
📄
ip6tables-save
92.74 KB
05/09/2023 06:42:18 PM
rwxr-xr-x
📄
ipmaddr
17.99 KB
01/10/2017 04:25:08 AM
rwxr-xr-x
📄
iptables
92.74 KB
05/09/2023 06:42:18 PM
rwxr-xr-x
📄
iptables-restore
92.74 KB
05/09/2023 06:42:18 PM
rwxr-xr-x
📄
iptables-save
92.74 KB
05/09/2023 06:42:18 PM
rwxr-xr-x
📄
iptunnel
21.99 KB
01/10/2017 04:25:08 AM
rwxr-xr-x
📄
iscsi-iname
9.99 KB
04/06/2022 07:19:56 PM
rwxr-xr-x
📄
iscsi_discovery
5.16 KB
09/29/2016 06:33:24 PM
rwxr-xr-x
📄
iscsiadm
381.95 KB
04/06/2022 07:19:56 PM
rwxr-xr-x
📄
iscsid
398.15 KB
04/06/2022 07:19:56 PM
rwxr-xr-x
📄
iscsistart
358.13 KB
04/06/2022 07:19:56 PM
rwxr-xr-x
📄
isosize
22.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
kbdrate
9.99 KB
01/22/2018 01:49:48 PM
rwxr-xr-x
📄
killall5
22.08 KB
11/01/2017 09:00:29 PM
rwxr-xr-x
📄
ldconfig
387 bytes
05/03/2022 10:19:39 AM
rwxr-xr-x
📄
ldconfig.real
1001.67 KB
05/03/2022 10:19:39 AM
rwxr-xr-x
📄
logsave
10 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
losetup
82.19 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
lsmod
146.18 KB
07/28/2020 02:46:39 PM
rwxr-xr-x
📄
lvchange
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvconvert
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvcreate
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvdisplay
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvextend
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvm
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvmconf
12.55 KB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvmconfig
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvmdiskscan
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvmdump
10.07 KB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvmetad
82.13 KB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvmpolld
70.45 KB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvmsadc
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvmsar
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvreduce
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvremove
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvrename
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvresize
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvs
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
lvscan
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
mdadm
577.4 KB
01/14/2020 07:10:59 PM
rwxr-xr-x
📄
mdmon
321.24 KB
01/14/2020 07:10:59 PM
rwxr-xr-x
📄
mii-tool
18.46 KB
01/10/2017 04:25:08 AM
rwxr-xr-x
📄
mkdosfs
34.5 KB
01/24/2017 11:48:34 PM
rwxr-xr-x
📄
mke2fs
126.31 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
mkfs
10.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
mkfs.bfs
30.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
mkfs.cramfs
34.01 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
mkfs.ext2
126.31 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
mkfs.ext3
126.31 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
mkfs.ext4
126.31 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
mkfs.fat
34.5 KB
01/24/2017 11:48:34 PM
rwxr-xr-x
📄
mkfs.minix
78.09 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
mkfs.msdos
34.5 KB
01/24/2017 11:48:34 PM
rwxr-xr-x
📄
mkfs.ntfs
78.11 KB
11/01/2022 11:57:16 AM
rwxr-xr-x
📄
mkfs.vfat
34.5 KB
01/24/2017 11:48:34 PM
rwxr-xr-x
📄
mkfs.xfs
423.52 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
mkhomedir_helper
18.02 KB
02/02/2023 09:24:07 AM
rwxr-xr-x
📄
mkntfs
78.11 KB
11/01/2022 11:57:16 AM
rwxr-xr-x
📄
mkswap
78.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
modinfo
146.18 KB
07/28/2020 02:46:39 PM
rwxr-xr-x
📄
modprobe
146.18 KB
07/28/2020 02:46:39 PM
rwxr-xr-x
📄
mount.fuse
9.99 KB
08/11/2016 12:52:18 PM
rwxr-xr-x
📄
mount.lowntfs-3g
106.67 KB
11/01/2022 11:57:16 AM
rwxr-xr-x
📄
mount.ntfs
142.7 KB
11/01/2022 11:57:16 AM
rwxr-xr-x
📄
mount.ntfs-3g
142.7 KB
11/01/2022 11:57:16 AM
rwxr-xr-x
📄
mount.vmhgfs
42.16 KB
09/19/2022 10:14:07 PM
rwxr-xr-x
📄
nameif
14.14 KB
01/10/2017 04:25:08 AM
rwxr-xr-x
📄
ntfsclone
54.12 KB
11/01/2022 11:57:16 AM
rwxr-xr-x
📄
ntfscp
34.1 KB
11/01/2022 11:57:16 AM
rwxr-xr-x
📄
ntfslabel
26.1 KB
11/01/2022 11:57:16 AM
rwxr-xr-x
📄
ntfsresize
70.12 KB
11/01/2022 11:57:16 AM
rwxr-xr-x
📄
ntfsundelete
50.1 KB
11/01/2022 11:57:16 AM
rwxr-xr-x
📄
on_ac_power
2.16 KB
03/12/2018 12:51:32 AM
rwxr-xr-x
📄
pam_extrausers_chkpwd
34 KB
02/02/2023 09:24:07 AM
rwxr-xr-x
📄
pam_extrausers_update
34 KB
02/02/2023 09:24:07 AM
rwxr-xr-x
📄
pam_tally
10.01 KB
02/02/2023 09:24:07 AM
rwxr-xr-x
📄
pam_tally2
14.01 KB
02/02/2023 09:24:07 AM
rwxr-xr-x
📄
parted
78.09 KB
03/14/2019 05:05:58 PM
rwxr-xr-x
📄
partprobe
10.07 KB
03/14/2019 05:05:58 PM
rwxr-xr-x
📄
pivot_root
10.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
plipconfig
10 KB
01/10/2017 04:25:08 AM
rwxr-xr-x
📄
plymouthd
90.25 KB
04/04/2019 03:41:18 PM
rwxr-xr-x
📄
poweroff
178.08 KB
03/02/2023 12:58:02 PM
rwxr-xr-x
📄
pvchange
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
pvck
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
pvcreate
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
pvdisplay
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
pvmove
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
pvremove
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
pvresize
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
pvs
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
pvscan
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
rarp
32.45 KB
01/10/2017 04:25:08 AM
rwxr-xr-x
📄
raw
14.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
reboot
178.08 KB
03/02/2023 12:58:02 PM
rwxr-xr-x
📄
resize2fs
58.07 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
rmmod
146.18 KB
07/28/2020 02:46:39 PM
rwxr-xr-x
📄
route
64.3 KB
01/10/2017 04:25:08 AM
rwxr-xr-x
📄
rtacct
40.13 KB
01/26/2021 01:33:08 PM
rwxr-xr-x
📄
rtmon
50 KB
01/26/2021 01:33:08 PM
rwxr-xr-x
📄
runlevel
178.08 KB
03/02/2023 12:58:02 PM
rwxr-xr-x
📄
runuser
42.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
setcap
9.99 KB
11/16/2017 11:35:52 PM
rwxr-xr-x
📄
setvtrgb
14.13 KB
01/22/2018 01:49:48 PM
rwxr-xr-x
📄
sfdisk
106.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
sgdisk
174.17 KB
09/20/2017 08:05:45 PM
rwxr-xr-x
📄
shadowconfig
885 bytes
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
shutdown
178.08 KB
03/02/2023 12:58:02 PM
rwxr-xr-x
📄
slattach
40.45 KB
01/10/2017 04:25:08 AM
rwxr-xr-x
📄
start-stop-daemon
35.1 KB
05/25/2022 11:14:56 AM
rwxr-xr-x
📄
sulogin
46.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
swaplabel
14.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
swapoff
18.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
swapon
46.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
switch_root
14.07 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
sysctl
22.07 KB
08/09/2019 03:37:27 PM
rwxr-xr-x
📄
tc
453.79 KB
01/26/2021 01:33:08 PM
rwxr-xr-x
📄
telinit
178.08 KB
03/02/2023 12:58:02 PM
rwxr-xr-x
📄
tipc
53.99 KB
01/26/2021 01:33:08 PM
rwxr-xr-x
📄
tune2fs
102.25 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
udevadm
574.4 KB
03/02/2023 12:58:02 PM
rwxr-xr-x
📄
unix_chkpwd
34 KB
02/02/2023 09:24:07 AM
rwxr-xr-x
📄
unix_update
34 KB
02/02/2023 09:24:07 AM
rwxr-xr-x
📄
ureadahead
34.34 KB
04/09/2019 09:01:18 PM
rwxr-xr-x
📄
veritysetup
35.45 KB
08/03/2020 09:28:48 PM
rwxr-xr-x
📄
vgcfgbackup
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgcfgrestore
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgchange
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgck
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgconvert
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgcreate
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgdisplay
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgexport
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgextend
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgimport
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgimportclone
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgmerge
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgmknodes
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgreduce
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgremove
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgrename
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgs
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgscan
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
vgsplit
2.42 MB
01/23/2020 03:45:10 PM
rwxr-xr-x
📄
wipefs
38.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
xfs_repair
631.16 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xtables-multi
92.74 KB
05/09/2023 06:42:18 PM
rwxr-xr-x
📄
zramctl
90.19 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
Editing: lvmconf
Close
#!/bin/bash # # Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved. # # This file is part of the lvm2 package. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Edit an lvm.conf file to adjust various properties # # cluster with clvmd and/or locking lib? HANDLE_CLUSTER=0 # cluster without clvmd? HANDLE_HALVM=0 # also enable services appropriately (lvmetad, clvmd)? HANDLE_SERVICES=0 # also enable cmirrord service in addition? HANDLE_MIRROR_SERVICE=0 # also start/start services in addition to enabling/disabling them? START_STOP_SERVICES=0 function usage { echo "Usage: $0 <command>" echo "" echo "Commands:" echo "Enable clvm: --enable-cluster [--lockinglibdir <dir>] [--lockinglib <lib>]" echo "Disable clvm: --disable-cluster" echo "Enable halvm: --enable-halvm" echo "Disable halvm: --disable-halvm" echo "Set locking library: --lockinglibdir <dir> [--lockinglib <lib>]" echo "" echo "Global options:" echo "Config file location: --file <configfile>" echo "Set services: --services [--mirrorservice] [--startstopservices]" echo "" echo "Use the separate command 'lvmconfig' to display configuration information" } function set_default_use_lvmetad_var { eval "$(lvm dumpconfig --type default global/use_lvmetad 2>/dev/null)" if [ "$?" != 0 ]; then USE_LVMETAD=0 else USE_LVMETAD=$use_lvmetad fi } function parse_args { while [ -n "$1" ]; do case "$1" in --enable-cluster) LOCKING_TYPE=3 USE_LVMETAD=0 HANDLE_CLUSTER=1 shift ;; --disable-cluster) LOCKING_TYPE=1 set_default_use_lvmetad_var HANDLE_CLUSTER=1 shift ;; --enable-halvm) LOCKING_TYPE=1 USE_LVMETAD=0 HANDLE_HALVM=1 shift ;; --disable-halvm) LOCKING_TYPE=1 set_default_use_lvmetad_var HANDLE_HALVM=1 shift ;; --lockinglibdir) if [ -n "$2" ]; then LOCKINGLIBDIR=$2 shift 2 else usage exit 1 fi HANDLE_CLUSTER=1 ;; --lockinglib) if [ -n "$2" ]; then LOCKINGLIB=$2 shift 2 else usage exit 1 fi HANDLE_CLUSTER=1 ;; --file) if [ -n "$2" ]; then CONFIGFILE=$2 shift 2 else usage exit 1 fi ;; --services) HANDLE_SERVICES=1 shift ;; --mirrorservice) HANDLE_MIRROR_SERVICE=1 shift ;; --startstopservices) START_STOP_SERVICES=1 shift ;; *) usage exit 1 esac done if [ -n "$LOCKINGLIBDIR" ] || [ -n "$LOCKINGLIB" ]; then LOCKING_TYPE=2 USE_LVMETAD=0 fi } function validate_args { [ -z "$CONFIGFILE" ] && CONFIGFILE="/etc/lvm/lvm.conf" if [ ! -f "$CONFIGFILE" ] then echo "$CONFIGFILE does not exist" exit 10 fi if [ "$HANDLE_CLUSTER" = 1 ] && [ "$HANDLE_HALVM" = 1 ]; then echo "Either HA LVM or cluster method may be used at one time" exit 18 fi if [ "$HANDLE_SERVICES" = 0 ]; then if [ "$HANDLE_MIRROR_SERVICE" = 1 ]; then echo "--mirrorservice may be used only with --services" exit 19 fi if [ "$START_STOP_SERVICES" = 1 ]; then echo "--startstopservices may be used only with --services" exit 19 fi fi if [ -z "$LOCKING_TYPE" ] && [ -z "$LOCKINGLIBDIR" ]; then usage exit 1 fi if [ -n "$LOCKINGLIBDIR" ]; then if [ "${LOCKINGLIBDIR:0:1}" != "/" ] then echo "Prefix must be an absolute path name (starting with a /)" exit 12 fi if [ -n "$LOCKINGLIB" ] && [ ! -f "$LOCKINGLIBDIR/$LOCKINGLIB" ] then echo "$LOCKINGLIBDIR/$LOCKINGLIB does not exist, did you do a \"make install\" ?" exit 11 fi fi if [ "$LOCKING_TYPE" = 1 ] ; then if [ -n "$LOCKINGLIBDIR" ] || [ -n "$LOCKINGLIB" ]; then echo "Superfluous locking lib parameter, ignoring" fi fi } umask 0077 parse_args "$@" validate_args SCRIPTFILE=/etc/lvm/.lvmconf-script.tmp TMPFILE=/etc/lvm/.lvmconf-tmp.tmp # Flags so we know which parts of the file we can replace and which need # adding. These are return codes from grep, so zero means it IS present! have_type=1 have_dir=1 have_library=1 have_use_lvmetad=1 have_global=1 grep -q '^[[:blank:]]*locking_type[[:blank:]]*=' "$CONFIGFILE" have_type=$? grep -q '^[[:blank:]]*library_dir[[:blank:]]*=' "$CONFIGFILE" have_dir=$? grep -q '^[[:blank:]]*locking_library[[:blank:]]*=' "$CONFIGFILE" have_library=$? grep -q '^[[:blank:]]*use_lvmetad[[:blank:]]*=' "$CONFIGFILE" have_use_lvmetad=$? # Those options are in section "global {" so we must have one if any are present. if [ "$have_type" = 0 ] || [ "$have_dir" = 0 ] || [ "$have_library" = 0 ] || [ "$have_use_lvmetad" = 0 ] then # See if we can find it... grep -q '^[[:blank:]]*global[[:blank:]]*{' $CONFIGFILE have_global=$? if [ "$have_global" = 1 ] then echo "global keys but no 'global {' found, can't edit file" exit 13 fi fi if [ "$LOCKING_TYPE" = 2 ] && [ -z "$LOCKINGLIBDIR" ] && [ "$have_dir" = 1 ]; then echo "no library_dir specified in $CONFIGFILE" exit 16 fi # So if we don't have "global {" we need to create one and # populate it if [ "$have_global" = 1 ] then if [ -z "$LOCKING_TYPE" ]; then LOCKING_TYPE=1 fi if [ "$LOCKING_TYPE" = 3 ] || [ "$LOCKING_TYPE" = 2 ]; then cat "$CONFIGFILE" - <<EOF > "$TMPFILE" global { # Enable locking for cluster LVM locking_type = $LOCKING_TYPE library_dir = "$LOCKINGLIBDIR" # Disable lvmetad in cluster use_lvmetad = 0 EOF if [ $? != 0 ] then echo "failed to create temporary config file, $CONFIGFILE not updated" exit 14 fi if [ -n "$LOCKINGLIB" ]; then cat - <<EOF >> "$TMPFILE" locking_library = "$LOCKINGLIB" EOF if [ $? != 0 ] then echo "failed to create temporary config file, $CONFIGFILE not updated" exit 16 fi fi cat - <<EOF >> "$TMPFILE" } EOF fi # if we aren't setting cluster locking, we don't need to create a global section if [ $? != 0 ] then echo "failed to create temporary config file, $CONFIGFILE not updated" exit 17 fi else # # We have a "global {" section, so add or replace the # locking entries as appropriate # if [ -n "$LOCKING_TYPE" ]; then if [ "$have_type" = 0 ] then SEDCMD=" s/^[[:blank:]]*locking_type[[:blank:]]*=.*/\ \ \ \ locking_type = $LOCKING_TYPE/g" else SEDCMD=" /global[[:blank:]]*{/a\ \ \ \ locking_type = $LOCKING_TYPE" fi fi if [ -n "$LOCKINGLIBDIR" ]; then if [ "$have_dir" = 0 ] then SEDCMD="${SEDCMD}\ns'^[[:blank:]]*library_dir[[:blank:]]*=.*'\ \ \ \ library_dir = \"$LOCKINGLIBDIR\"'g" else SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ library_dir = \"$LOCKINGLIBDIR\"" fi fi if [ -n "$LOCKINGLIB" ]; then if [ "$have_library" = 0 ] then SEDCMD="${SEDCMD}\ns/^[[:blank:]]*locking_library[[:blank:]]*=.*/\ \ \ \ locking_library = \"$LOCKINGLIB\"/g" else SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ locking_library = \"$LOCKINGLIB\"" fi fi if [ "$have_use_lvmetad" = 0 ] then SEDCMD="${SEDCMD}\ns'^[[:blank:]]*use_lvmetad[[:blank:]]*=.*'\ \ \ \ use_lvmetad = $USE_LVMETAD'g" else SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ use_lvmetad = $USE_LVMETAD" fi echo -e "$SEDCMD" > "$SCRIPTFILE" sed <"$CONFIGFILE" >"$TMPFILE" -f "$SCRIPTFILE" if [ $? != 0 ] then echo "sed failed, $CONFIGFILE not updated" exit 15 fi fi # Now we have a suitably editted config file in a temp place, # backup the original and copy our new one into place. cp "$CONFIGFILE" "$CONFIGFILE.lvmconfold" if [ $? != 0 ] then echo "failed to backup old config file, $CONFIGFILE not updated" exit 2 fi cp "$TMPFILE" "$CONFIGFILE" if [ $? != 0 ] then echo "failed to copy new config file into place, check $CONFIGFILE is still OK" exit 3 fi rm -f "$SCRIPTFILE" "$TMPFILE" function set_service { local type=$1 local action=$2 shift 2 if [ "$type" = "systemd" ]; then if [ "$action" = "activate" ]; then for i in "$@"; do unset LoadState eval "$($SYSTEMCTL_BIN show "$i" -p LoadState 2>/dev/null)" test "$LoadState" = "loaded" || continue $SYSTEMCTL_BIN enable "$i" if [ "$START_STOP_SERVICES" = 1 ]; then $SYSTEMCTL_BIN start "$i" fi done elif [ "$action" = "deactivate" ]; then for i in "$@"; do unset LoadState eval "$($SYSTEMCTL_BIN show "$i" -p LoadState 2>/dev/null)" test "$LoadState" = "loaded" || continue "$SYSTEMCTL_BIN" disable "$i" if [ "$START_STOP_SERVICES" = 1 ]; then "$SYSTEMCTL_BIN" stop "$i" fi done fi elif [ "$type" = "sysv" ]; then if [ "$action" = "activate" ]; then for i in "$@"; do "$CHKCONFIG_BIN" --list "$i" > /dev/null || continue "$CHKCONFIG_BIN" "$i" on if [ "$START_STOP_SERVICES" = 1 ]; then "$SERVICE_BIN" "$i" start fi done elif [ "$action" = "deactivate" ]; then for i in "$@"; do "$CHKCONFIG_BIN" --list "$i" > /dev/null || continue if [ "$START_STOP_SERVICES" = 1 ]; then "$SERVICE_BIN" "$i" stop fi "$CHKCONFIG_BIN" "$i" off done fi fi } # Start/stop and enable/disable services if needed. if [ "$HANDLE_SERVICES" = 1 ]; then SYSTEMCTL_BIN=$(which systemctl 2>/dev/null) CHKCONFIG_BIN=$(which chkconfig 2>/dev/null) SERVICE_BIN=$(which service 2>/dev/null) # Systemd services if [ -n "$SYSTEMCTL_BIN" ]; then if [ "$USE_LVMETAD" = 0 ]; then set_service systemd deactivate lvm2-lvmetad.service lvm2-lvmetad.socket else set_service systemd activate lvm2-lvmetad.socket fi if [ "$LOCKING_TYPE" = 3 ]; then set_service systemd activate lvm2-cluster-activation.service if [ "$HANDLE_MIRROR_SERVICE" = 1 ]; then set_service activate lvm2-cmirrord.service fi else set_service systemd deactivate lvm2-cluster-activation.service if [ "$HANDLE_MIRROR_SERVICE" = 1 ]; then set_service systemd deactivate lvm2-cmirrord.service fi fi # System V init scripts elif [ -n "$SERVICE_BIN" ] && [ -n "$CHKCONFIG_BIN" ]; then if [ "$USE_LVMETAD" = 0 ]; then set_service sysv deactivate lvm2-lvmetad else set_service sysv activate lvm2-lvmetad fi if [ "$LOCKING_TYPE" = 3 ]; then set_service sysv activate clvmd if [ "$HANDLE_MIRROR_SERVICE" = 1 ]; then set_service sysv activate cmirrord fi else set_service sysv deactivate clvmd if [ "$HANDLE_MIRROR_SERVICE" = 1 ]; then set_service sysv deactivate cmirrord fi fi # None of the service tools found, error out else echo "Missing tools to handle services" exit 20 fi fi