Athou / commafeed

Google Reader inspired self-hosted RSS reader.
https://www.commafeed.com
Apache License 2.0
2.62k stars 363 forks source link

Better launcher #663

Closed Hubcapp closed 2 years ago

Hubcapp commented 9 years ago

I think a good idea would be to work on the way CommaFeed can be managed from an administrator's point of view. Currently, following the README, CommaFeed is launched by running the command java -jar target/commafeed.jar server config.yml.

Although that does start the application the same way on any OS (simplicity), this is undesirable for several reasons.

  1. When launching an application this way, the process name is just "java", which makes it harder to kill (you can't just say killall java e.g., since that might kill other java applications). In windows, it is worse, because from a task manager, the only thing you can find out is that a program called java is running. You might be able to determine which java.exe to kill if you have process explorer installed.
  2. People who want to deploy CommaFeed need to create their own startup scripts. This is inconvenient; one should be supplied so that deployment is easy.
  3. To kill the process, something like this must be done:

    user@linux:~$ ps -ef | grep commafeed
    root     6624     1  5 07:17 pts/2    00:01:50 java -jar ./target/commafeed.jar server config.yml
    user     6921  6820  0 07:50 pts/3    00:00:00 grep commafeed
    user@linux:~$ sudo kill 6624
    user@linux:~$ ps -ef | grep commafeed
    user     6925  6820  0 07:50 pts/3    00:00:00 grep commafeed

    Contrast that with a normal daemon:

    user@linux:~$ sudo /etc/init.d/commafeed stop
    stopping service commafeed ... [stopped]

    On Windows, if CommaFeed got its own service, all the cool stuff in SC would be available. A java service wrapper like YAJSW might make this an easy to implement task, but the licensing requirements would have to be looked into (LGPL for versions of YAJSW less than 12, apache 2.0 also applies for version 12 and up)

  4. Starting the service, you have to navigate to the directory where CommaFeed is stored. Normally, you can just run /etc/init.d/commafeed start from anywhere. Windows users probably don't mind this, since they don't use command lines anyway.
  5. If you start CommaFeed with java -jar target/commafeed.jar server config.yml from a remote terminal, it starts blasting debug and info messages all over your tty, even after you've finished starting CommaFeed. This renders the whole terminal useless for anything but monitoring CommaFeed.

What I would really like to see at some point is the hosting of an unofficial repository which lets you download the latest precompiled commafeed.deb so that setup and management of CommaFeed is as easy as

user@linux:~$ sudo nano /etc/apt/sources.list
user@linux:~$ sudo apt-get update
user@linux:~$ sudo apt-get install commafeed
user@linux:~$ /etc/init.d/commafeed start
error! make sure to set up your config file 
user@linux:~$ sudo nano /etc/commafeed/config.yml

Then to update, it's just sudo apt-get install commafeed again; really simple.

Athou commented 9 years ago

I agree with you, we could provide scripts for popular os and distros.

I still need to find some time to find out how PPAs work. In the mean time though, the build process generates a .deb package using https://github.com/reines/dropwizard-debpkg-maven-plugin for debian/ubuntu. That package will create everything you mention (an init.d service, a config file at /etc/commafeed.yml, ...)

dsferruzza commented 9 years ago

@Hubcapp FYI I wrote a blog post on using supervisor to manage my CommaFeed instance: http://david.sferruzza.fr/posts/2014-08-18-how-to-install-commafeed-rss-reader.html

Ashex commented 9 years ago

For systemd the following unit file will work:

[Unit]
Description=Commafeed RSS aggregator

[Service]
Type=simple
WorkingDirectory=/opt/commafeed
ExecStart=/usr/bin/java -jar /opt/commafeed/commafeed.jar server /opt/commafeed/config.yml
StandardOutput=null
User=commafeed
Group=commafeed

[Install]
WantedBy=multi-user.target

Regarding repository, I'll be putting together an AUR package in a few weeks.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.