Discussion:
[schooltool] SchoolTool at startup? (Ubuntu 6)
Graham Perrin
2006-10-16 23:23:04 UTC
Permalink
I can start SchoolTool from the command line,
sudo schooltool -d
but it's not starting automatically when the OS starts.

Ubuntu 6.06.
SchoolTool 0.11.4 installed using Synaptic.

Any suggestions?

I have no idea where to start. New to Linux (more familiar with
SchoolTool on Mac OS X).

Ideally, I'd like to resolve this from the command line.

TIA for any advice.
Brian Sutherland
2006-10-16 23:23:04 UTC
Permalink
Post by Graham Perrin
I can start SchoolTool from the command line,
sudo schooltool -d
but it's not starting automatically when the OS starts.
Ubuntu 6.06.
SchoolTool 0.11.4 installed using Synaptic.
Any suggestions?
Ok, I'm just going to go through a number of de-bugging steps.

First try to start the daemon from the init script:

sudo /etc/init.d/schooltool start

Also, please run these commands (they shouldn't need root priviliges):

cat /etc/default/schooltool
cat /etc/init.d/schooltool
ls -l /etc/rc2.d/*sch*
runlevel
ls -l /usr/bin/schooltool

Just post any output from these here.
Post by Graham Perrin
I have no idea where to start. New to Linux (more familiar with
SchoolTool on Mac OS X).
Ideally, I'd like to resolve this from the command line.
TIA for any advice.
_______________________________________________
Schooltool mailing list
http://lists.schooltool.org/mailman/listinfo/schooltool
--
Brian Sutherland

Metropolis - "it's the first movie with a robot. And she's a woman.
And she's EVIL!!"
Peter Hartmann
2006-10-16 23:23:04 UTC
Permalink
I had to manually edit the init script by adding the -d switch to get
it to run at boottime. that was an older k12 rpm.

Peter
Post by Brian Sutherland
Post by Graham Perrin
I can start SchoolTool from the command line,
sudo schooltool -d
but it's not starting automatically when the OS starts.
Ubuntu 6.06.
SchoolTool 0.11.4 installed using Synaptic.
Any suggestions?
Ok, I'm just going to go through a number of de-bugging steps.
sudo /etc/init.d/schooltool start
cat /etc/default/schooltool
cat /etc/init.d/schooltool
ls -l /etc/rc2.d/*sch*
runlevel
ls -l /usr/bin/schooltool
Just post any output from these here.
Post by Graham Perrin
I have no idea where to start. New to Linux (more familiar with
SchoolTool on Mac OS X).
Ideally, I'd like to resolve this from the command line.
TIA for any advice.
_______________________________________________
Schooltool mailing list
http://lists.schooltool.org/mailman/listinfo/schooltool
--
Brian Sutherland
Metropolis - "it's the first movie with a robot. And she's a woman.
And she's EVIL!!"
_______________________________________________
Schooltool mailing list
http://lists.schooltool.org/mailman/listinfo/schooltool
Graham Perrin
2006-10-16 23:23:04 UTC
Permalink
Post by Brian Sutherland
Ok, I'm just going to go through a number of de-bugging steps.
sudo /etc/init.d/schooltool start
This works, but only if the HTML port is set to 7080 (the default).

If I
sudo dpkg-reconfigure schooltool
and change the port from 7080 to 80, then
sudo /etc/init.d/schooltool start
*appears* to work (I see "[ ok ]") but
the schooltool processes behave strangely. From what I can gather,
glancing at
top
whilst the the script is running,

one schooltool process is owned by root
another schooltool process is owned by schooltool

the schooltool process owned by root drops to the bottom of the list,
the schooltool process owned by schooltool remains at the top (> 99%
CPU),
then two more schooltool processes appear, owned by schooltool, so we
have

three schooltool processes owned by schooltool
one schooltool process owned by root
and after the brief appearance of the third and fourth processes
all four processes disappear.

If I
sudo dpkg-reconfigure schooltool
and revert the port from 80 to 7080, then
sudo /etc/init.d/schooltool start
works correctly.

sudo schooltool -d
works correctly when the port is set to 80.
Marius Gedminas
2006-10-16 23:23:04 UTC
Permalink
Post by Graham Perrin
Post by Brian Sutherland
Ok, I'm just going to go through a number of de-bugging steps.
sudo /etc/init.d/schooltool start
This works, but only if the HTML port is set to 7080 (the default).
Or anything higher than 1024, I would think.

The Debian package runs the schooltool server process as user
'schooltool', not as 'root', for security reasons. Non-root processes
cannot listen on network ports < 1024.

You can, however, have Apache listening on port 80 and forwarding the
requests to SchoolTool. It is documented in SchoolTool's readme, the
section about virtual hosting.

Marius Gedminas
--
Seen on a button at an SF Convention:
Veteran of the Bermuda Triangle Expeditionary Force. 1990-1951.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.schooltool.org/pipermail/schooltool/attachments/20060904/5164a731/attachment.pgp
Brian Sutherland
2006-10-16 23:23:04 UTC
Permalink
Post by Graham Perrin
and change the port from 7080 to 80, then
Yep, this is the problem as Marius pointed out. Debian, for security
reasons, runs schooltool as the user schooltool not as root. Meaning
that you cannot use schooltool on ports below 1024.

The solution you can implement right now to run schooltool on port 80 is
to use apache virtual hosting (as described in the schooltool README):

http://source.schooltool.org/svn/trunk/schooltool/README.txt

A further solution would be to implement privilege dropping in
schooltool, where schooltool would start as root, bind to the ports and
then change it's user to something else.

btw, do we have an FAQ? This question has come up a few times before.
--
Brian Sutherland

Metropolis - "it's the first movie with a robot. And she's a woman.
And she's EVIL!!"
Adrian Wells
2006-10-16 23:23:04 UTC
Permalink
Post by Brian Sutherland
btw, do we have an FAQ? This question has come up a few times before.
So does that make it a FAQ? :-)
Tom Hoffman
2006-10-16 23:23:04 UTC
Permalink
Post by Adrian Wells
Post by Brian Sutherland
btw, do we have an FAQ? This question has come up a few times before.
So does that make it a FAQ? :-)
We probably should have a FAQ... but if people don't find the README,
will they find the FAQ?

--Tom
Brian Sutherland
2006-10-16 23:23:05 UTC
Permalink
Post by Tom Hoffman
Post by Adrian Wells
Post by Brian Sutherland
btw, do we have an FAQ? This question has come up a few times before.
So does that make it a FAQ? :-)
We probably should have a FAQ... but if people don't find the README,
will they find the FAQ?
"Problems starting SchoolTool on Ubuntu or Debian"

is much more obvious than:

"Virtual Hosting with Apache"
--
Brian Sutherland

Metropolis - "it's the first movie with a robot. And she's a woman.
And she's EVIL!!"
Adrian Wells
2006-10-16 23:23:05 UTC
Permalink
Post by Brian Sutherland
Post by Tom Hoffman
Post by Adrian Wells
Post by Brian Sutherland
btw, do we have an FAQ? This question has come up a few times before.
So does that make it a FAQ? :-)
We probably should have a FAQ... but if people don't find the README,
will they find the FAQ?
FAQ's tend to give more succinct info and are more likely to be read! (IMO)
Post by Brian Sutherland
"Problems starting SchoolTool on Ubuntu or Debian"
"Virtual Hosting with Apache"
Then why not have a searchable FAQ with keywords. e.g.

Q: Problems starting SchoolTool on Ubuntu or Debian
Keywords: Virtual;Hosting;Apache;
A: Really cool answer...

I do this for a club website that I run and I have a small app to help me
write the FAQ. It has the ability to set up similie lists. If one of the
similie words is in the Q or A, the others are added to the Keywords.

e.g. if the Q holds "W&W" (W&W is a shorthand for the club name) Then
"Wind and wheels;windandwheels;wind & wheels; wind&wheels;club;"
is added to the keywords list.

It's very crude as I spend little time on the site; it has a PHP page to
search / display and the FAQ held in another [flat] file. * shows every FAQ!

Just a thought....

Graham Perrin
2006-10-16 23:23:04 UTC
Permalink
Post by Brian Sutherland
cat /etc/default/schooltool
# This is a configuration file for /etc/init.d/schooltool.

# Comment out the line below or change the value to something else
than "yes"
# if you don't want to start the schooltool server on system startup.
The
# init script will effectively be disabled.
SCHOOLTOOL_ENABLE="yes"
Post by Brian Sutherland
cat /etc/init.d/schooltool
#! /bin/sh
#
# Start the server.
#
set -e

package=schooltool

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/$package
NAME=$package
DESC="SchoolTool"
PNAME=$package # truncated to 15 chars by the kernel
PIDFILE=/var/run/$package/$package.pid
SCRIPTNAME=/etc/init.d/$package
CONFIGFILE=/etc/$package/$package.conf
DEFAULTFILE=/etc/default/$package

# Gracefully exit if the package has been removed or is not configured.
test -x $DAEMON || exit 0
test -f $CONFIGFILE || exit 0

if [ -r $DEFAULTFILE ]; then
. $DEFAULTFILE
fi

. /lib/lsb/init-functions

case "$1" in
start)
# Exit if the server has been disabled in /etc/default/$package
[ "$SCHOOLTOOL_ENABLE" != "yes" ] && exit 0

# Make sure we have a /var/run sub-directory
[ -d /var/run/$package ] \
|| install --group $package --owner $package -d /var/run/
$package

log_begin_msg "Starting $DESC..."
start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE \
--chuid $package --startas $DAEMON -- -d >/dev/null \
|| log_end_msg 1
log_end_msg 0
;;
stop)
log_begin_msg "Stopping $DESC..."
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
--name $PNAME --retry 30 || log_end_msg 1
sleep 1
log_end_msg 0
;;
restart|force-reload)
# Exit if the server has been disabled in /etc/default/$package
[ "$SCHOOLTOOL_ENABLE" != "yes" ] && exit 0

# Make sure we have a /var/run sub-directory
[ -d /var/run/$package ] || mkdir -p /var/run/$package
chown $package:$package /var/run/$package

log_begin_msg "Restarting $DESC..."
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
--name $PNAME --retry 30 || log_end_msg 1
sleep 1
start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE \
--chuid $package --startas $DAEMON -- -d >/dev/null \
|| log_end_msg 1
log_end_msg 0
;;
*)
log_success_msg "Usage: $SCRIPTNAME {start|stop|restart|
force-reload}" \
Post by Brian Sutherland
&2
exit 1
;;
esac

exit 0
Post by Brian Sutherland
ls -l /etc/rc2.d/*sch*
lrwxrwxrwx 1 root root 20 2006-09-04 11:11 /etc/rc2.d/S20schooltool -
Post by Brian Sutherland
../init.d/schooltool
runlevel
N 2
Post by Brian Sutherland
ls -l /usr/bin/schooltool
-rwxr-xr-x 1 root root 386 2006-03-22 13:10 /usr/bin/schooltool
Post by Brian Sutherland
Just post any output from these here.
Regards
Graham
Graham Perrin
2006-10-16 23:23:04 UTC
Permalink
Thanks to Brian, Marius and Peter for the explanations/suggestions.

I now have Apache installed and listening on port 80, forwarding the
requests to SchoolTool on port 7080.

A closing observation:

The readme at <http://source.schooltool.org/svn/trunk/schooltool/
README.txt> refers to

mod_proxy

In my Apache installation
(Ubuntu 6.06 server, PowerPC, Apache installed from universe)
I have

libproxy

(not mod_proxy).

Best regards
Graham
Loading...