diff --git a/redis.sh b/redis.sh index 5f452bd..8cc92a4 100755 --- a/redis.sh +++ b/redis.sh @@ -10,7 +10,6 @@ cp ${SOURCE_DIR}/srv/redis/redis.conf /srv/redis/redis.conf chown -R 6379:6379 /srv/redis # Configure Redis service -cp ${SOURCE_DIR}/lib/systemd/system/redis.service /lib/systemd/system/redis.service -systemctl daemon-reload -systemctl enable redis -systemctl start redis +cp ${SOURCE_DIR}/etc/init.d/redis /etc/init.d/redis +rc-update add redis boot +service redis start diff --git a/redis/etc/init.d/redis b/redis/etc/init.d/redis new file mode 100644 index 0000000..8c9b818 --- /dev/null +++ b/redis/etc/init.d/redis @@ -0,0 +1,16 @@ +#!/sbin/openrc-run + +description="Redis docker container" + +depend() { + need docker net + use dns logger netmount +} + +start() { + /usr/bin/docker run -d --rm --name redis -v /srv/redis/redis.conf:/etc/redis.conf -v /srv/redis/data:/var/lib/redis redis +} + +stop() { + /usr/bin/docker stop redis +} diff --git a/redis/lib/systemd/system/redis.service b/redis/lib/systemd/system/redis.service deleted file mode 100644 index 1ff338e..0000000 --- a/redis/lib/systemd/system/redis.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Redis Docker container -After=network.target - -[Service] -Type=simple -ExecStart=/usr/bin/docker run --rm --name redis -v /srv/redis/redis.conf:/etc/redis.conf -v /srv/redis/data:/var/lib/redis redis -ExecStop=/usr/bin/docker stop redis - -[Install] -WantedBy=multi-user.target