#57 Handle SIGHUP differently

v2.2.x
closed-fixed
general (34)
5
2007-12-21
2007-07-04
Derek Atkins
No

From the gttr-general mailing list:

Em Ter, 2007-07-03 às 18:25 -0400, Derek Atkins escreveu:
> The only other feature I'd like to see (and honestly I'd love to see
> it in your bugfix release) is a change in handling SIGHUP. Instead
> of handing SIGHUP as a Save+Shutdown I'd love to see SIGHUP handled
> like a "shutdown/startup" -- i.e., drop all state and re-read the data file.

Could you, please, file a bug about that in the sourceforge bug tracker, so I don't forget about it?

-------------

More on this: Because there's no specific "Save" UI, it would be useful to have two signal handlers, one that implemented "Save" (but NOT exit!) and another that handled the "Reload" (aka shutdown/startup). I'd recommend SIGUSR1 for the Save and SIGHUP for the Reload.

Thanks!

Discussion

  • Logged In: YES
    user_id=5955
    Originator: NO

    Gnotime already saves its data file periodically, so I think the result
    of reloading the data file would not be the same as what you want from
    a SIGHUP (which I think is going back to the state it was when started).

    Similarly, unless you really want to force saving the data file at a
    given time (I can't see why you would need this), there's no reason for
    the Save button or SIGUSR1. I would opt for adding a Save button if this
    is really desired.

     
  • Derek Atkins
    Derek Atkins
    2007-08-17

    Logged In: YES
    user_id=181397
    Originator: YES

    Please don't assume what I want without asking, because in this case you're wrong. I do NOT want SIGHUP to mean "go back to the state it was when started", I want to to re-read the existing datafile. I'm also sorry you can't see a reason, so let me give you one:

    I want to automate (via a script) adding new entries (Projects) to my gnotime data file. I would implement this in my automation script by:
    Force-Save (SIGUSR1)
    manipulate the XML file
    Force-Reload (SIGHUP)

    At this point gnotime would have the updated data. I admit it would be better if there were some way to do this via gnotime itself, but I deemed that too hard to do in the timeframe of a patch release, whereas the Save/Reload functionality should be rather straightforward. Unfortunately right now I have to do the following to get the functionality I want:
    kill gnotime
    manipulate the XML file
    restart gnotime

    I'd much prefer NOT having to kill and restart gnotime in order to script this functionality.

     
  • Logged In: YES
    user_id=5955
    Originator: NO

    > Please don't assume what I want without asking, because in this case
    > you're wrong.

    I thought I would be wrong and you really would have a good reason to
    ask for this feature. And that's why I commented on the bug report
    instead of simply closing it with a "Wont Fix" resolution ;)

    Now I can see why you need this.

    I'll integrate Patch #1724152 augmenting it with "Save data"
    and "Reload data" commands. This will allow you to do what you want
    using an interface I plan to keep on future releases.

    After 2.2.3, I'll also add the possibility to manipulate the project
    list through Dbus, so you will not need to mess with the XML file.

     
  • Logged In: YES
    user_id=5955
    Originator: NO

    Just commited the implementation of save and reload file through DBus.

    Now you can do:
    gnotime-remote save-file
    change XML file
    gnotime-remote reload-file

     
    • status: open --> closed-fixed
     
  • Linas Vepstas
    Linas Vepstas
    2007-12-21

    • assigned_to: nobody --> goedson