Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions etc/fpnd.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ pid_name = fpnd.pid

[Paths]
home_dir = /usr/lib/fpnd/
log_path = /var/log/
pid_path = /run/
log_path = /var/log/fpnd
pid_path = /run/fpnd
20 changes: 17 additions & 3 deletions etc/fpnd.openrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

: ${FPND_STATE_DIR:=/var/lib/${RC_SVCNAME}}
: ${FPND_GROUP:=root}
: ${FPND_USER:=root}

CONFIG="/etc/fpnd/fpnd.ini"

description="fpnd - FreePN daemon"
command="/usr/sbin/fpnd.py"
pidfile="/run/${SVCNAME}.pid"
command="/usr/bin/fpnd.py"
pidfile="/run/${RC_SVCNAME}.pid"
command_args="start"

depend() {
Expand All @@ -19,4 +23,14 @@ start_pre() {
eerror "Configuration file ${CONFIG} not found"
return 1
fi
checkpath \
-d \
--mode 0755 \
--owner ${FPND_USER}:${FPND_GROUP} \
"${FPND_STATE_DIR}"
}

stop_pre() {
[ "${RC_CMD}" = "restart" ] && sleep 1
return 0
}
12 changes: 11 additions & 1 deletion etc/fpnd.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@ Requires=zerotier-one.service
After=zerotier-one.service

[Service]
User=fpnd
Group=fpnd

RuntimeDirectory=fpnd
LogsDirectory=fpnd
StateDirectory=fpnd

AmbientCapabilities=CAP_NET_ADMIN CAP_NET_RAW CAP_DAC_OVERRIDE
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW CAP_DAC_OVERRIDE

ExecStart=/usr/lib/fpnd/fpnd.py start
ExecStop=/bin/kill -TERM $MAINPID
KillMode=none
PIDFile=/run/fpnd.pid
Type=forking
PIDFile=/run/fpnd/fpnd.pid
TimeoutStartSec=5
TimeoutStopSec=7

Expand Down
2 changes: 1 addition & 1 deletion node_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@
'wait_for_moon',
]

__version__ = '0.8.9'
__version__ = '0.8.10'
__version_info__ = tuple(int(segment) for segment in __version__.split('.'))
2 changes: 1 addition & 1 deletion node_tools/helper_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def get_cachedir(dir_name='fpn_cache', user_dirs=False):
dirs = AppDirs('fpnd', 'FreePN')
temp_dir = dirs.user_cache_dir
if not user_dirs and not NODE_SETTINGS['runas_user']:
temp_dir = dirs.site_data_dir
temp_dir = '/var/lib/fpnd'

if not os.access(temp_dir, os.X_OK | os.W_OK):
logger.error('Cannot use path {}!'.format(temp_dir))
Expand Down