more fixes/updates

This commit is contained in:
Michael Legleux
2026-03-30 17:02:31 -07:00
parent e36ba02762
commit cfcb09933a
6 changed files with 33 additions and 36 deletions

View File

@@ -23,26 +23,24 @@ if ! mkdir "$LOCKDIR" 2>/dev/null; then
fi
trap cleanup EXIT
source /etc/os-release
can_update=false
if [[ "$ID" == "ubuntu" || "$ID" == "debian" ]] ; then
# Silent update
if command -v apt-get &>/dev/null; then
apt-get update -qq
# The next line is an "awk"ward way to check if the package needs to be updated.
XRPLD=$(apt-get install -s --only-upgrade xrpld | awk '/^Inst/ { print $2 }')
test "$XRPLD" == "xrpld" && can_update=true
if apt-get -s --only-upgrade install xrpld 2>/dev/null | grep -q '^Inst xrpld'; then
can_update=true
fi
function apply_update {
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq xrpld
}
elif [[ "$ID" == "fedora" || "$ID" == "centos" || "$ID" == "rhel" || "$ID" == "scientific" ]] ; then
RIPPLE_REPO=${RIPPLE_REPO-stable}
yum --disablerepo=* --enablerepo="ripple-${RIPPLE_REPO}" clean expire-cache
elif command -v yum &>/dev/null; then
REPO=${REPO-stable}
yum --disablerepo=* --enablerepo="ripple-${REPO}" clean expire-cache
# yum check-update exits 100 when updates are available, 0 for none, 1 for errors.
yum check-update -q --enablerepo="ripple-${RIPPLE_REPO}" xrpld
yum check-update -q --enablerepo="ripple-${REPO}" xrpld
rc=$?
if [ $rc -eq 100 ]; then
can_update=true
@@ -52,10 +50,10 @@ elif [[ "$ID" == "fedora" || "$ID" == "centos" || "$ID" == "rhel" || "$ID" == "s
fi
function apply_update {
yum update -y --enablerepo="ripple-${RIPPLE_REPO}" xrpld
yum update -y --enablerepo="ripple-${REPO}" xrpld
}
else
echo "unrecognized distro!"
echo "No supported package manager found (apt-get or yum)"
exit 1
fi

View File

@@ -2,11 +2,14 @@
Description=XRP Ledger Daemon
After=network-online.target
Wants=network-online.target
StartLimitIntervalSec=60
StartLimitBurst=3
[Service]
Type=simple
ExecStart=/opt/xrpld/bin/xrpld --net --silent --conf /etc/opt/xrpld/xrpld.cfg
Restart=on-failure
RestartSec=5
NoNewPrivileges=true
ProtectSystem=full
PrivateTmp=true

View File

@@ -1,5 +1,2 @@
d /var/lib/xrpld 0750 xrpld xrpld -
d /var/lib/xrpld/db 0750 xrpld xrpld -
d /var/log/xrpld 0750 xrpld xrpld -
d /var/opt/ripple/lib 0750 xrpld xrpld -
d /var/opt/ripple/log 0750 xrpld xrpld -