On Sat, Feb 12, 2011 at 07:44:08PM +0100, Dennis Keitzel wrote: > The sobby init-script is configured to create a default autosave.obby file, > if there isn't one yet. However, as the file is created by root, the file is > owned by root. Therefore, the sobby user is unable to write data to this file > and the autosave functionality isn't working. This results in loss of data > upon sobby restart. > To fix this issue, the owner of the autosave.obby file has to be changed to > sobby.
I see several issues: 1) sobby should print warnings and cry that it cannot write the autosave file. 2) If you apt-get install --reinstall sobby, then the owner's correct, because the postinst does an unconditional chown. 3) We really want to chown the created file to sobby. 4) At least sobby will serialize its state to the file on SIGTERM, so it should have an opportunity to save existing data if we chown the file first. This should fix it, then, even for existing installations. diff -u sobby-0.4.7/debian/sobby.init sobby-0.4.7/debian/sobby.init --- sobby-0.4.7/debian/sobby.init +++ sobby-0.4.7/debian/sobby.init @@ -39,6 +39,7 @@ user_table chat EOF + chown sobby: "$SOBBY_SESSION_FILE" } do_start() { diff -u sobby-0.4.7/debian/changelog sobby-0.4.7/debian/changelog --- sobby-0.4.7/debian/changelog +++ sobby-0.4.7/debian/changelog @@ -1,3 +1,12 @@ +sobby (0.4.7-3) unstable; urgency=low + + * The init script creates a new session file if it does not exist yet. + Add a chown call to make it writeable by sobby, which is not run + as root. Make sure to chown the file before sobby's stopped, in + the hope that it writes out...(Closes: #613085) + + -- Philipp Kern <pk...@debian.org> Sat, 12 Feb 2011 20:07:04 +0100 + sobby (0.4.7-2) unstable; urgency=low * Add an init script by adapting an initial proposal by Dustin Kirkland. only in patch2: unchanged: --- sobby-0.4.7.orig/debian/prerm +++ sobby-0.4.7/debian/prerm @@ -0,0 +1,14 @@ +#!/bin/sh +# vim:set et ts=2 sw=2: + +set -e + +# Make sure the autosave file is actually writeable before stopping the +# server. +if [ -d /var/lib/sobby ]; then + chown -R sobby:sobby /var/lib/sobby + chmod 0750 /var/lib/sobby +fi + +#DEBHELPER# + Will upload in a bit... Kind regards Philipp Kern
signature.asc
Description: Digital signature