Problems while starting the first time

Support for the Debian/Ubuntu package, created by JCFP.
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
nimanic
Newbie
Newbie
Posts: 3
Joined: May 25th, 2013, 10:09 am

Problems while starting the first time

Post by nimanic »

Hi,

on my last installations the sabnzbd was working without any problems but this time i have this failure.

Code: Select all

sudo service sabnzbdplus start
 * Starting SABnzbd+ binary newsgrabber
** (sabnzbdplus:3667): WARNING **: Befehlszeile »dbus-launch --autolaunch=02e8920755914f84ef89296f00000007 --binary-syntax --close-stderr« brach mit von Null verschiedenem Beenden-Status 1 ab: Autolaunch error: X11 initialization failed.\n
Error:
Can't write to logfile
                                                                                             [fail]
Progress:
1. sudo add-apt-repository ppa:jcfp/ppa
2. sudo apt-get update
3. apt-get install sabnzbdplus
4. sabnzbdplus:
Installiert: 0.7.12-0ubuntu1~jcfp1~precise
Kandidat: 0.7.12-0ubuntu1~jcfp1~precise
Versionstabelle:
*** 0.7.12-0ubuntu1~jcfp1~precise 0
500 http://ppa.launchpad.net/jcfp/ppa/ubuntu/ precise/main amd64 Packages
100 /var/lib/dpkg/status
0.6.15-1 0
500 http://de.archive.ubuntu.com/ubuntu/ precise/multiverse amd64 Packages
5. i than directly changed the /etc/defaults/sab... configuration to enable the service.
6. than i startetd the service with "sudo service sabnzbdplus start"
7. i got the above mentioned failure

I am not interested in any X11 output or anything, i am doing anything from remote.

Thanks for your help and ideas.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Problems while starting the first time

Post by shypike »

Find the sabnzbd.ini file and make sure it contains this line:
ntfosd_enable = 0
nimanic
Newbie
Newbie
Posts: 3
Joined: May 25th, 2013, 10:09 am

Re: Problems while starting the first time

Post by nimanic »

No change at all :-(

Code: Select all

#!/bin/sh
#
# Copyright (C) 2008-2012 by JCF Ploemen <[email protected]>
# released under GPL, version 2 or later

################################################
#                                              #
#  TO CONFIGURE EDIT /etc/default/sabnzbdplus  #
#                                              #
################################################

### BEGIN INIT INFO
# Provides:          sabnzbdplus
# Required-Start:    $local_fs $network $remote_fs
# Required-Stop:     $local_fs $network $remote_fs
# Should-Start:      NetworkManager
# Should-Stop:       NetworkManager
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: SABnzbd+ binary newsgrabber
# Description:       SABnzbd+ is a web-based binary newsgrabber with nzb
#                    support, designed to download files from Usenet.
#                    This script provides that functionality as a system
#                    service, starting the program on boot.
### END INIT INFO

[b]ntfosd_enable = 0[/b]

DAEMON=/usr/bin/sabnzbdplus
SETTINGS=/etc/default/sabnzbdplus

([ -x $DAEMON ] && [ -r $SETTINGS ]) || exit 0

DESC="SABnzbd+ binary newsgrabber"
DEFOPTS="--daemon"
PYTHONEXEC="^$(sed -n '1s/^#\! \?\([a-z0-9\.\/]\+\)\(.*\)/\1(\2)?/p' $DAEMON)"
PIDFILE=/var/run/sabnzbdplus.pid
SETTINGS_LOADED=FALSE

# these are only accepted from the settings file
unset USER CONFIG HOST PORT EXTRAOPTS

. /lib/lsb/init-functions

check_retval() {
	if [ $? -eq 0 ]; then
		log_end_msg 0
		return 0
	else
		log_end_msg 1
		exit 1
	fi
}

is_running() {
	# returns 0 when running, 1 otherwise
	PID="$(pgrep -f -x -u ${USER%:*} "$PYTHONEXEC $DAEMON $DEFOPTS.*")"
	RET=$?
	[ $RET -gt 1 ] && exit 1 || return $RET
}

load_settings() {
	if [ $SETTINGS_LOADED != "TRUE" ]; then
		. $SETTINGS

		[ -z "$USER" ] && {
			log_warning_msg "$DESC: not configured, aborting. See $SETTINGS";
			return 1; }
		[ -z "${USER%:*}" ] && exit 1

		OPTIONS="$DEFOPTS"
		[ -n "$CONFIG" ] && OPTIONS="$OPTIONS --config-file $CONFIG"
		[ -n "$HOST" ] && SERVER="$HOST" || SERVER=
		[ -n "$PORT" ] && SERVER="$SERVER:$PORT"
		[ -n "$SERVER" ] && OPTIONS="$OPTIONS --server $SERVER"
		[ -n "$EXTRAOPTS" ] && OPTIONS="$OPTIONS $EXTRAOPTS"
		SETTINGS_LOADED=TRUE
	fi
	return 0
}

start_sab() {
	load_settings || exit 0
	if ! is_running; then
		log_daemon_msg "Starting $DESC"
		start-stop-daemon --quiet --chuid $USER --start --exec $DAEMON -- $OPTIONS
		check_retval
		# create a pidfile; we don't use it but some monitoring app likes to have one
		[ -w $(dirname $PIDFILE) ] && \
			pgrep -f -x -n -u ${USER%:*} "$PYTHONEXEC $DAEMON $OPTIONS" > $PIDFILE
	else
		log_success_msg "$DESC: already running (pid $PID)"
	fi
}

stop_sab() {
	load_settings || exit 0
	if is_running; then
		TMPFILE="$(mktemp --tmpdir sabnzbdplus.XXXXXXXXXX)"
		[ $? -eq 0 ] || exit 1
		trap '[ -f "$TMPFILE" ] && rm -f "$TMPFILE"' EXIT
		echo "$PID" > "$TMPFILE"
		log_daemon_msg "Stopping $DESC"
		start-stop-daemon --stop --user ${USER%:*} --pidfile "$TMPFILE" --retry 30
		check_retval
	else
		log_success_msg "$DESC: not running"
	fi
	[ -f $PIDFILE ] && rm -f $PIDFILE
}

case "$1" in
	start)
		start_sab
	;;
	stop)
		stop_sab
	;;
	force-reload|restart)
		stop_sab
		start_sab
	;;
	status)
		load_settings || exit 4
		if is_running; then
			log_success_msg "$DESC: running (pid $PID)"
		else
			log_success_msg "$DESC: not running"
			[ -f $PIDFILE ] && exit 1 || exit 3
		fi
	;;
	*)
		log_failure_msg "Usage: $0 {start|stop|restart|force-reload|status}"
		exit 3
	;;
esac

exit 0
I Pput it right at the beginning, is this ok or does it have to be somewhere else?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Problems while starting the first time

Post by shypike »

That's not the sabnzbd.ini file.
Check your $HOME/.sabnzbd folder first or use "find".
User avatar
jcfp
Release Testers
Release Testers
Posts: 1022
Joined: February 7th, 2008, 12:45 pm

Re: Problems while starting the first time

Post by jcfp »

As shypike said, the sabnzbd.ini is the program's settings file, not the startup script in /etc/init.d/. See http://wiki.sabnzbd.org/faq#toc19 for the (default) locations on various operating systems.

You will have to fix this error first though:
Error:
Can't write to logfile
Without write access to its log file, the program will refuse to run backgrounded. This error is typically a permissions issue (wrong ownership on an existing log file?).
nimanic
Newbie
Newbie
Posts: 3
Joined: May 25th, 2013, 10:09 am

Re: Problems while starting the first time

Post by nimanic »

Hi,

thanks for your help, sorry for the wrong file.

That was the problem, i have no idea, why the permission are different from thee last times but changing it to 777 make it work.

Thanks a lot for your help
Post Reply