Commit a4a380cc authored by Thomas Goirand's avatar Thomas Goirand

More init script fix.

parent 370e3388
......@@ -18,22 +18,13 @@ NAME=octavia-agent-certs-ramfs
case $1 in
start)
log_daemon_msg "Starting Octavia Agent RAMDISK" "$NAME"
modprobe brd rd_size=1024000 max_part=2 rd_nr=1
passphrase=$(head /dev/urandom | tr -dc "a-zA-Z0-9" | fold -w 32 | head -n 1)
certs_path=$(grep base_cert_dir /etc/octavia/amphora-agent.conf | awk '{print $3}')
mkdir -p "${certs_path}"
echo -n "${passphrase}" | cryptsetup luksFormat /dev/ram0 -
echo -n "${passphrase}" | cryptsetup luksOpen /dev/ram0 certfs-ramfs -
mkfs.ext2 /dev/mapper/certfs-ramfs
mount /dev/mapper/certfs-ramfs "${certs_path}"
log_end_msg 0
/sbin/octavia-agent-ramfs-start
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping Octavia Agent RAMDISK" "$NAME"
certs_path=$(awk "/base_cert_dir / {printf \$3}" /etc/octavia/amphora-agent.conf)
umount "${certs_path}"
cryptsetup luksClose /dev/mapper/certfs-ramfs
log_end_msg 0
/sbin/octavia-agent-ramfs-stop
log_end_msg $?
;;
restart|force-reload)
# Restart the daemon.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment