-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syncthing - Update 0.14.44 - Generic Service approach #3094
Conversation
adc3cc4
to
1a98e35
Compare
@Safihre @ymartin59 I have just realized that |
Ah, I thought you did the same for tvheaded? With the special But that's indeed not really deamon, for example when the service restarts itself it will be shown as Stopped in the Package Center. |
I kinda just improvised, maybe the real |
This is why I was asking... |
I found that But indeed for other ones, maybe a general service provider would be great! |
If application produces |
In fact |
Please copy wizard french translations from |
It is also possible to patch the app so it produces a pidfile as we need.
This is to be preferred if easy to do. There were benefits using the daemon
thing over a simple shell but I can't remember exactly. Go with whatever
that works, just make sure to test special cases like when the app restart
itself.
Le 13 janv. 2018 10:36 PM, "Yves Martin" <notifications@github.com> a
écrit :
Please copy wizard french translations from spk/demoservice
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3094 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AATe9EexKQunqQ0_puevoeHlv1sNEDPEks5tKSH6gaJpZM4RbM70>
.
|
I will investigate if |
To solve automatic restart after update for jackett, someone asks how to integrated into DSM |
@ymartin59 Discussion in #3027 is interesting. It seems you are also right that the http://majikshoe.blogspot.nl/2014/12/starting-service-on-synology-dsm-5.html |
While this would benefit from #3123, it actually needs |
My idea is to create a clean / alternate |
Sounds good! 👍 |
1a98e35
to
d13a324
Compare
d13a324
to
58d83e8
Compare
@cytec Can you help me explain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a remark. I will fix check so that STARTABLE
can be removed
spk/syncthing/src/service-setup.sh
Outdated
fi | ||
|
||
# Add special options to start-stop-daemon command | ||
SERVICE_OPTIONS = SYNCTHING_OPTIONS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not work. I propose to rename SYNCTHING_OPTIONS
into SERVICE_OPTIONS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it doesn't work, in my test-branch I already updated that but just didn't push it yet.
But the name needs to stay SYNCTHING_OPTIONS
because users could have setup some custom options during previous versions via ${CONFIG_DIR}/options.conf
.
That options.conf
is kept during the upgrade, so for backwards-compatibility it needs this.
#!/bin/sh
# This file will be added to start-stop-status script
# For possible options see syncthing --help
# Example: uncomment this to start syncthing with all devices paused
# SYNCTHING_OPTIONS="${SYNCTHING_OPTIONS} -paused"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Have not read inside options.conf
. So I wait for your review request.
@Safihre i try my best: go 1.4 is needed because if you install from source and want to build the toolchains you need a go compiler installed (go 1.4 was the last version with a compiler written in c) so you need to bootstrap it with go 1.4 The rules for More info about all that can be found on the install go from source site So if you want to enable |
Really instructive... Sounds like wiki would be the right place for this information. |
By the way, |
Aah yes, all permissions and deamon stuff is merged now so I can finish this. |
@ymartin59 I need help 😨 Which then creates the ### Package specific variables and functions
# Base service USER to run background process prefixed according to DSM
USER="syncthing"
PRIV_PREFIX=sc-
SYNOUSER_PREFIX=svc-
if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 6 ]; then EFF_USER="${SYNOUSER_PREFIX}${USER}"; else EFF_USER="${PRIV_PREFIX}${USER}"; fi
# Service port
SERVICE_PORT="7070"
# start-stop-status script redirect stdout/stderr to LOG_FILE
LOG_FILE="${SYNOPKG_PKGDEST}/var/${SYNOPKG_PKGNAME}.log"
# Service command has to deliver its pid into PID_FILE
PID_FILE="${SYNOPKG_PKGDEST}/var/${SYNOPKG_PKGNAME}.pid"
# Service command to execute with start-stop-daemon
SERVICE_EXE="env HOME=${CONFIG_DIR} ${SYNCTHING}"
SERVICE_OPTIONS="${SYNCTHING_OPTIONS}"
# Invoke shell function if available
call_func ()
{
FUNC=$1
if type "$FUNC" | grep -q 'function' 2>/dev/null; then
echo "Invoke $FUNC" >> ${INST_LOG}
eval ${FUNC}
fi
}
# Setup environment
PATH="${SYNOPKG_PKGDEST}/bin:${PATH}"
SYNCTHING="${SYNOPKG_PKGDEST}/bin/syncthing"
CONFIG_DIR="${SYNOPKG_PKGDEST}/var"
SYNCTHING_OPTIONS="-home=${CONFIG_DIR}"
# Read additional startup options from /usr/local/syncthing/var/options.conf
if [ -f ${CONFIG_DIR}/options.conf ]; then
source ${CONFIG_DIR}/options.conf
fi
LEGACY_GROUP="users"
service_postinst ()
{
# Add also to "users" group in case it was there
# This way it keeps any permissions it used to have
syno_user_add_to_legacy_group "${EFF_USER}" "${USER}" "${LEGACY_GROUP}"
# Discard legacy obsolete busybox user account
BIN=${SYNOPKG_PKGDEST}/bin
$BIN/busybox --install $BIN >> ${INST_LOG}
$BIN/delgroup "${USER}" "users" >> ${INST_LOG}
$BIN/deluser "${USER}" >> ${INST_LOG}
} |
@Safihre Please push your recent changes, it will be easier for me to understand.
Cheers |
I don't think this is ready yet, never got it to work properly. That's why this was the only one I didn't put it in the checklist at the end of #3138. |
Added wizard page explaining Syncthing permissions Also add new user to "users" group in case it was there, just to be sure
@ymartin59 I pushed some updates, now the command is successfully passed by using a dummy that I then later overwrite in
|
@Safihre From my point of view, there is no need for "dummy" as command and options are not dynamic. Setting these in
I will have to grab your branch to diagnose... |
I tried that, but that doesn't work, it results in:
Because the |
Also still need to add I am not good in Shell/Bash so maybe you know the fix :) |
@Safihre OK I will give it a try soon... |
@Safihre I am in trouble with |
Superseed by #3391 |
Checklist
all-supported
completed successfully