Attached is a zip file containing 3 files I've modified
to add start/stop/reload capability via CGI. Basically,
the way it works is:
BackupPC_Admin has 3 new actions: Action_StartServer,
Action_StopServer, and Action_Reload. If the server is
running and an admin user accesses the general info page,
two buttons are shown - Stop & Reload. These are implemented
via new serverMesg commands in BackupPC. I'm not sure if
the host reload command works properly - I just used the same
approach as BackupPC_dump. Well, it works (e.g. doesn't give
an error and updates the host logfile), but I'm not sure if
it's doing the right thing with merging the new host config
into the main configuration.
Starting the server is a little more difficult. I'm using
the init.d script on Redhat 7.3 and I've setup ssh to allow
backuppc to ssh as root without a password. So, my first
cut at starting the server via Action_StartServer is to do
a "/etc/init.d/backuppc start" as root over ssh. This might
not work for everyone. (BTW - there is a small typo in the
init.d script for Redhat under 'stop': 'backupcpc' should
be 'backuppc'). If an admin user accesses the general info
page when the server isn't running, a 'Start Server' button
and a short message are shown.
The other file is en.pm - me siento, pero yo no se otras
lenguas... OK, yo se un poquito de espanol, pero pienso
que mis cambios necessitan mas pruebas ;}
This all seems to work happily on my otherwise vanilla
BackupPC 2.0.0 setup. My cvs client isn't connecting per
the instructions on sourceforge, and I'm a little paranoid
about mangling the repository, so the files are attached.
I've put wrapper comments around all of my changes.