From c9c6b73692f6d0dd389da983a30ff44c2b50f870 Mon Sep 17 00:00:00 2001 From: Chen Chen Date: Fri, 4 Mar 2022 00:22:29 +0800 Subject: [PATCH 1/2] allow 'systemctl enable' and ensure start after local and remote fs --- scripts/robinhood.service.in | 5 +++++ scripts/robinhood@.service.in | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/scripts/robinhood.service.in b/scripts/robinhood.service.in index 5a9f9f813..aaafd6e88 100644 --- a/scripts/robinhood.service.in +++ b/scripts/robinhood.service.in @@ -1,5 +1,7 @@ [Unit] Description=Robinhood server +After=local-fs.target remote-fs.target +Requires=local-fs.target #only works if config file is unique [Service] @@ -9,3 +11,6 @@ EnvironmentFile=-@CONFDIR@/sysconfig/robinhood LimitNOFILE=8096 ExecStart=@SBINDIR@/robinhood $RBH_OPT ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/scripts/robinhood@.service.in b/scripts/robinhood@.service.in index d75859ef5..5b6b491d1 100644 --- a/scripts/robinhood@.service.in +++ b/scripts/robinhood@.service.in @@ -1,5 +1,7 @@ [Unit] Description=Robinhood server for %I +After=local-fs.target remote-fs.target +Requires=local-fs.target [Service] Type=simple @@ -9,3 +11,6 @@ EnvironmentFile=-@CONFDIR@/sysconfig/robinhood.%I LimitNOFILE=8096 ExecStart=@SBINDIR@/robinhood $RBH_OPT -f @CONFDIR@/robinhood.d/%I.conf ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target From 0baa347a463e09d56fda9ee703807b1984e5174e Mon Sep 17 00:00:00 2001 From: Chen Chen Date: Mon, 7 Mar 2022 15:14:50 +0800 Subject: [PATCH 2/2] add comments to indicate alternative config options --- scripts/robinhood.service.in | 5 ++++- scripts/robinhood@.service.in | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/robinhood.service.in b/scripts/robinhood.service.in index aaafd6e88..4516966fc 100644 --- a/scripts/robinhood.service.in +++ b/scripts/robinhood.service.in @@ -1,8 +1,11 @@ [Unit] Description=Robinhood server +#only works if config file is unique After=local-fs.target remote-fs.target Requires=local-fs.target -#only works if config file is unique +#to speedup the starting, remove the above two lines, +# then uncomment and modify the following 'RequiresMountsFor' directive +#RequiresMountsFor=/path/to/scan [Service] Type=simple diff --git a/scripts/robinhood@.service.in b/scripts/robinhood@.service.in index 5b6b491d1..2b0d13ee2 100644 --- a/scripts/robinhood@.service.in +++ b/scripts/robinhood@.service.in @@ -2,6 +2,9 @@ Description=Robinhood server for %I After=local-fs.target remote-fs.target Requires=local-fs.target +#to speedup the starting, remove the above two lines, +# then uncomment and modify the following 'RequiresMountsFor' directive +#RequiresMountsFor=/path/to/scan [Service] Type=simple