Skip to content
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

i2pd: does not start with init script #10977

Closed
BKPepe opened this issue Jan 10, 2020 · 4 comments · Fixed by #11041
Closed

i2pd: does not start with init script #10977

BKPepe opened this issue Jan 10, 2020 · 4 comments · Fixed by #11041

Comments

@BKPepe
Copy link
Member

BKPepe commented Jan 10, 2020

Maintainer: @yangfl
Environment: Turris Omnia, mvebu (cortex-a9), OpenWrt master

Description:

Installing i2pd (2.28.0-1.6) to root...
Configuring i2pd.
root@turris:~# /etc/init.d/i2pd start
chown: : No such file or directory

I can start it without init script just fine.

@neheb
Copy link
Contributor

neheb commented Jan 12, 2020

I assume the pidfile functionality can be removed since this is using procd.

edit: never mind.

neheb added a commit to neheb/packages that referenced this issue Jan 17, 2020
Ran init script through shellcheck. Simplified several statements.

Replaced INSTALL_CONF with INSTALL_DATA. i2pd runs as non-root and so the
conf file must be accessible.

Fixed: openwrt#10977

Signed-off-by: Rosen Penev <rosenp@gmail.com>
@BKPepe
Copy link
Member Author

BKPepe commented Jan 31, 2020

Same issue in OpenWrt 19.07.

root@turris:/# /etc/init.d/i2pd start
mkdir: can't create directory '': No such file or directory
chown: : No such file or directory
chown: : No such file or directory

@neheb
Copy link
Contributor

neheb commented Jan 31, 2020

Would be good to backport that commit.

@amzamzamzamz
Copy link

amzamzamzamz commented Jul 25, 2021

Same issue in OpenWrt 19.07.

root@turris:/# /etc/init.d/i2pd start
mkdir: can't create directory '': No such file or directory
chown: : No such file or directory
chown: : No such file or directory

Change i2pd in /etc/init.d/ to:


#!/bin/sh /etc/rc.common

Copyright (C) 2017 OpenWrt.org

USE_PROCD=1

START=90
STOP=10

default params

PROG=/usr/sbin/i2pd
USER="i2pd"
GROUP="i2pd"
PIDFILE=/var/run/i2pd.pid
DATADIR=/var/lib/i2pd
CONFFILE=/etc/i2pd/i2pd.conf
ADDRESSBOOKDIR=/root/.i2pd/addressbook

. /lib/functions.sh

start_service() {
local data_dir
local addressbook_dir

config_load i2pd

config_get data_dir i2pd data_dir

config_get addressbook_dir i2pd addressbook_dir

## Setting up data dir
if [ ! -d "$DATADIR" ]; then
	mkdir -p "$DATADIR"
	ln -s /usr/share/i2pd/certificates "$DATADIR/certificates"
	ln -s /etc/i2pd/tunnels.conf "$DATADIR/tunnels.conf"
	if [ -n "$ADDRESSBOOKDIR" ]; then
		if [ ! -d "$ADDRESSBOOKDIR" ]; then
			mkdir -p "$ADDRESSBOOKDIR"
		fi
		ln -s "$ADDRESSBOOKDIR" "$$DATADIR/addressbook"
	fi
fi

## We need permissions
chown "$USER:$GROUP" "$DATADIR"
chown "$USER:$GROUP" "$ADDRESSBOOKDIR"
touch "$PIDFILE"
chown "$USER:adm" "$PIDFILE"

procd_open_instance
procd_set_param command "$PROG" --service --conf="$CONFFILE" --pidfile "$PIDFILE" --http.enabled 1 --http.address 127.0.0.1 --http.port 7070  --http.auth 0
## Don't know about i2pd user's HOME
procd_set_param env "HOME=$DATADIR"
procd_set_param limits nofile=4096
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param user "$USER"
procd_set_param pidfile "$PIDFILE"
procd_close_instance

}


There is no errors at service starting but it can't connect to any i2p-router. So it doesn't work anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants