Make redis service (init file) manageable by userRedis as service on CentOs6How to restart docker containers(in specific order) automatically on every reboot in Ubuntu 14.04How to install redis 3.0.7 on Debian 8systemd and OpenVPN woes after an Ubuntu upgradeCannot install redis serversystemd: finish the execution of custom shell script before starting nginxUpstart script with expect scriptingvncserver blank display — debian 9 guest VM w/ubuntu 16 hostredis hvals: get return as array structureHow to enable redis service in Ubuntu 14.04
Is exact Kanji stroke length important?
Customer Requests (Sometimes) Drive Me Bonkers!
Why not increase contact surface when reentering the atmosphere?
How does Loki do this?
How can we prove that any integral in the set of non-elementary integrals cannot be expressed in the form of elementary functions?
Class Action - which options I have?
How does it work when somebody invests in my business?
What is the difference between "behavior" and "behaviour"?
What Brexit proposals are on the table in the indicative votes on the 27th of March 2019?
Risk of infection at the gym?
How can I kill an app using Terminal?
Do sorcerers' subtle spells require a skill check to be unseen?
What happens if you roll doubles 3 times then land on "Go to jail?"
Is expanding the research of a group into machine learning as a PhD student risky?
How can I get through very long and very dry, but also very useful technical documents when learning a new tool?
Integer addition + constant, is it a group?
Unreliable Magic - Is it worth it?
Proof of work - lottery approach
How long to clear the 'suck zone' of a turbofan after start is initiated?
How do we know the LHC results are robust?
Is HostGator storing my password in plaintext?
How do I extract a value from a time formatted value in excel?
How to check is there any negative term in a large list?
How did Arya survive the stabbing?
Make redis service (init file) manageable by user
Redis as service on CentOs6How to restart docker containers(in specific order) automatically on every reboot in Ubuntu 14.04How to install redis 3.0.7 on Debian 8systemd and OpenVPN woes after an Ubuntu upgradeCannot install redis serversystemd: finish the execution of custom shell script before starting nginxUpstart script with expect scriptingvncserver blank display — debian 9 guest VM w/ubuntu 16 hostredis hvals: get return as array structureHow to enable redis service in Ubuntu 14.04
Below is my redis init file:
#!/bin/sh
. /lib/lsb/init-functions
EXEC=/usr/local/bin/redis-server
CLIEXEC=/usr/local/bin/redis-cli
PIDFILE=/var/run/redis.pid
CONF="/etc/redis/redis.conf"
redis_start()
if [ -f $PIDFILE ]
then
echo "$PIDFILE exists, process is already running or crashed"
else
echo "Starting Redis server..."
$EXEC $CONF
fi
redis_stop()
if [ ! -f $PIDFILE ]
then
echo "$PIDFILE does not exist, process is not running"
else
PID=$(cat $PIDFILE)
echo "Stopping ..."
$CLIEXEC shutdown
while [ -x /proc/$PID ]
do
echo "Waiting for Redis to shutdown ..."
sleep 1
done
echo "Redis stopped"
fi
case "$1" in
start)
redis_start
;;
stop)
redis_stop
;;
restart)
redis_stop
redis_start
;;
status)
status -p $PIDFILE redis
script_result=$?
;;
*)
echo "Please use start, stop, restart or status as first argument"
;;
esac
exit 0
I have to make this service managed by redis user. It is relatively easy to do in redis.service file:
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User= redis_user
Group= redis_group
ExecStart=/usr/local/bin/redis-server redis_conf_dir /redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
[Install]
WantedBy=multi-user.target
But I don't know what arguments to pass and where to pass them in init file to make service manageable by redis user.
linux ubuntu users init-script redis
New contributor
atabak-5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Below is my redis init file:
#!/bin/sh
. /lib/lsb/init-functions
EXEC=/usr/local/bin/redis-server
CLIEXEC=/usr/local/bin/redis-cli
PIDFILE=/var/run/redis.pid
CONF="/etc/redis/redis.conf"
redis_start()
if [ -f $PIDFILE ]
then
echo "$PIDFILE exists, process is already running or crashed"
else
echo "Starting Redis server..."
$EXEC $CONF
fi
redis_stop()
if [ ! -f $PIDFILE ]
then
echo "$PIDFILE does not exist, process is not running"
else
PID=$(cat $PIDFILE)
echo "Stopping ..."
$CLIEXEC shutdown
while [ -x /proc/$PID ]
do
echo "Waiting for Redis to shutdown ..."
sleep 1
done
echo "Redis stopped"
fi
case "$1" in
start)
redis_start
;;
stop)
redis_stop
;;
restart)
redis_stop
redis_start
;;
status)
status -p $PIDFILE redis
script_result=$?
;;
*)
echo "Please use start, stop, restart or status as first argument"
;;
esac
exit 0
I have to make this service managed by redis user. It is relatively easy to do in redis.service file:
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User= redis_user
Group= redis_group
ExecStart=/usr/local/bin/redis-server redis_conf_dir /redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
[Install]
WantedBy=multi-user.target
But I don't know what arguments to pass and where to pass them in init file to make service manageable by redis user.
linux ubuntu users init-script redis
New contributor
atabak-5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Below is my redis init file:
#!/bin/sh
. /lib/lsb/init-functions
EXEC=/usr/local/bin/redis-server
CLIEXEC=/usr/local/bin/redis-cli
PIDFILE=/var/run/redis.pid
CONF="/etc/redis/redis.conf"
redis_start()
if [ -f $PIDFILE ]
then
echo "$PIDFILE exists, process is already running or crashed"
else
echo "Starting Redis server..."
$EXEC $CONF
fi
redis_stop()
if [ ! -f $PIDFILE ]
then
echo "$PIDFILE does not exist, process is not running"
else
PID=$(cat $PIDFILE)
echo "Stopping ..."
$CLIEXEC shutdown
while [ -x /proc/$PID ]
do
echo "Waiting for Redis to shutdown ..."
sleep 1
done
echo "Redis stopped"
fi
case "$1" in
start)
redis_start
;;
stop)
redis_stop
;;
restart)
redis_stop
redis_start
;;
status)
status -p $PIDFILE redis
script_result=$?
;;
*)
echo "Please use start, stop, restart or status as first argument"
;;
esac
exit 0
I have to make this service managed by redis user. It is relatively easy to do in redis.service file:
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User= redis_user
Group= redis_group
ExecStart=/usr/local/bin/redis-server redis_conf_dir /redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
[Install]
WantedBy=multi-user.target
But I don't know what arguments to pass and where to pass them in init file to make service manageable by redis user.
linux ubuntu users init-script redis
New contributor
atabak-5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Below is my redis init file:
#!/bin/sh
. /lib/lsb/init-functions
EXEC=/usr/local/bin/redis-server
CLIEXEC=/usr/local/bin/redis-cli
PIDFILE=/var/run/redis.pid
CONF="/etc/redis/redis.conf"
redis_start()
if [ -f $PIDFILE ]
then
echo "$PIDFILE exists, process is already running or crashed"
else
echo "Starting Redis server..."
$EXEC $CONF
fi
redis_stop()
if [ ! -f $PIDFILE ]
then
echo "$PIDFILE does not exist, process is not running"
else
PID=$(cat $PIDFILE)
echo "Stopping ..."
$CLIEXEC shutdown
while [ -x /proc/$PID ]
do
echo "Waiting for Redis to shutdown ..."
sleep 1
done
echo "Redis stopped"
fi
case "$1" in
start)
redis_start
;;
stop)
redis_stop
;;
restart)
redis_stop
redis_start
;;
status)
status -p $PIDFILE redis
script_result=$?
;;
*)
echo "Please use start, stop, restart or status as first argument"
;;
esac
exit 0
I have to make this service managed by redis user. It is relatively easy to do in redis.service file:
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User= redis_user
Group= redis_group
ExecStart=/usr/local/bin/redis-server redis_conf_dir /redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
[Install]
WantedBy=multi-user.target
But I don't know what arguments to pass and where to pass them in init file to make service manageable by redis user.
linux ubuntu users init-script redis
linux ubuntu users init-script redis
New contributor
atabak-5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
atabak-5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited yesterday
Rui F Ribeiro
41.8k1483142
41.8k1483142
New contributor
atabak-5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked yesterday
atabak-5atabak-5
1
1
New contributor
atabak-5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
atabak-5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
atabak-5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
atabak-5 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f508735%2fmake-redis-service-init-file-manageable-by-user%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
atabak-5 is a new contributor. Be nice, and check out our Code of Conduct.
atabak-5 is a new contributor. Be nice, and check out our Code of Conduct.
atabak-5 is a new contributor. Be nice, and check out our Code of Conduct.
atabak-5 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f508735%2fmake-redis-service-init-file-manageable-by-user%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
-init-script, linux, redis, ubuntu, users