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 ...@@ -18,22 +18,13 @@ NAME=octavia-agent-certs-ramfs
case $1 in case $1 in
start) start)
log_daemon_msg "Starting Octavia Agent RAMDISK" "$NAME" log_daemon_msg "Starting Octavia Agent RAMDISK" "$NAME"
modprobe brd rd_size=1024000 max_part=2 rd_nr=1 /sbin/octavia-agent-ramfs-start
passphrase=$(head /dev/urandom | tr -dc "a-zA-Z0-9" | fold -w 32 | head -n 1) log_end_msg $?
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
;; ;;
stop) stop)
log_daemon_msg "Stopping Octavia Agent RAMDISK" "$NAME" log_daemon_msg "Stopping Octavia Agent RAMDISK" "$NAME"
certs_path=$(awk "/base_cert_dir / {printf \$3}" /etc/octavia/amphora-agent.conf) /sbin/octavia-agent-ramfs-stop
umount "${certs_path}" log_end_msg $?
cryptsetup luksClose /dev/mapper/certfs-ramfs
log_end_msg 0
;; ;;
restart|force-reload) restart|force-reload)
# Restart the daemon. # 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