Thunderbird calendar with Etesync

I’m not sure what you mean. I did not run the command to start the service, just the “status” of etesync so we could see that the script worked. That is all I ran and yet it keeps repeating the same thing about the service being active over and over. I just wondered if that meant I did something wrong in the script (I did not change the original one I showed you) or something to cause this.

Sheila

@TrekJunky I now understand why I could never login to Etesync to get that password copied that Tbird needs: the service has to be running..duh! I kept trying it on the Windows machine and that OS does not have the service running. Once I opened a tab in this browser on Linux, where we got the service running, it was simple as going to it, logging in, and hitting that ‘copy password’ button which I then input into Tbird.

Sooo, all the calendars are enabled and now running in Tbird. And the fact that I could get into my etesync server means it is working.

Thanks for all your help. If I have any other issues, I’ll be back.

Sheila

1 Like

To be honest, the status message repeating never happened to me before. I researched it and couldn’t find anyone else with that issue. I don’t think it has anything to do with the functionality of etesync.

I tested a service that resides in the default.target.wants directory and could not duplicate your 11 repeats

Would you like me to install Etesync and see what happens

1 Like

@TrekJunky , no I won’t worry about it for now. I will check the status again after next reboot and see if it does it again, but as you said, etesync is working and that’s all that matters.

Again, thanks so much for all your help.

Sheila

2 Likes

Just curious. How is the status now that you have rebooted?

Cane,
It is still working great. I even deleted an event and edited a new one in Thunderbird and saw that the change took place on Etesync’s website where my calendars are stored. I am amazed.

Thanks so much for your help. I even used your instructions to create a service for barrier in systemd and it also works after reboot–figured out it was the firewall that was causing issues on both Linux and W11 in Barrier, so after creating the .service file and figuring out how to allow the Barrier port through, it, too is now working.

Can’t ask for more than that!

Sheila

1 Like

Glad to hear it. I’m real happy that I could help with both problems. Thanks for letting me know.

1 Like

So now that I am using a different init (SysV), it would save me a lot of time & research if I could understand how to get this working in MX Linux.

I could not figure out why it was not working until I tried:

systemctl --user start etesync-dav

Then I remembered we are not using systemd here. And that is fine with me. I want and need to learn the other init. One error that puzzles me is:

Failed to get properties: Process org.freedesktop.systemd1 exited with status 1

I looked at Write SysV Init Script to Start/Stop Service at the httpd script (as an example), but that entails more than is needed with etesync-dav.service. So even though I used the example in this thread and followed the Etesync user instructions, it did not work–probably because the script is incorrect and/or located in the wrong place for MX Linux.

While working this new job and maintaining my own business, time is limited. Any help on how to do what I did from these instructions in the new init would be much appreciated.

Thanks,
Sheila

The sysVinit scripts go in /etc/init.d

See here for how to start/stop it

1 Like

What a handy reference. Added to my Linux Notebook and will attempt today to get this service running.

Thanks,
Sheila

1 Like

Okay, this script writing for sysv is much more complex than sysd.

Following this source, I tried writing this as the script: /etc/init.d/etesync-dav.service:

#!/bin/sh

#### BEGIN INIT INFO
## Provides:          etesync-dav
## Required-Start:    $local_fs $remote_fs
## Required-Stop:     $local_fs $remote_fs
## Default-Start:     2 3 4 5
## Default-Stop:      0 1 6
## Short Description: ## Short-Description: Start and stop the etesync-dav service
#### END INIT INFO

start() {
  ## Start the service
  /usr/local/bin start
}

stop() {
  ## Stop the service
  /usr/local/bin stop
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
  *)
    echo "Usage: etesync-dav {start|stop|restart}"
    exit 1
    ;;
esac

exit 0

The source article had a lot of fancy things that I did not need in the script (i.e., “echo”) and a few I did not understand their purpose. So let’s compare the sample script with my additions/changes:

#!/bin/bash

## chkconfig: 2345 99 01
## description: PM2 is a process manager for Node.js applications.

. /etc/init.d/functions

PM2_HOME="/root/.pm2"
PM2_BIN="$(which pm2)"

start() {
    echo "Starting PM2"
    if [ -f "$PM2_HOME/pm2.pid" ]; then
        echo "PM2 is already running"
        exit 1
    fi
    $PM2_BIN start
}

stop() {
    echo "Stopping PM2"
    $PM2_BIN stop
}

restart() {
    echo "Restarting PM2"
    $PM2_BIN restart
}

status() {
    $PM2_BIN list
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        restart
        ;;
    status)
        status
        ;;
    *)
        echo "Usage: $0 {start|stop|restart|status}"
        exit 1
esac

exit $?

The only things I knew to add were the location of the service (not the script) “etesync-dav” and the name of the service: “etesync-dav.”

For the next step:

To install the service, make the init script executable and copy it to the /etc/init.d directory:

chmod +x /path/to/service_name
cp /path/to/service_name /etc/init.d/

The first command was similar to what I did in systemd. Note that I left the service file itself where I was originally told to have it. Thus, using the “path to service” of where that file is located now. But since I had already moved the service file to /etc/init.d, I did not do the second command.

Yet running

service etesync-dav start

says unrecognized service.

So what am I doing wrong in this scenario?

This is the instruction for (systemd) installing & auto starting etesync-dav and which I first completed in an attempt to get it running:

Download & Run
To download the DAV, head over to the releases page and download the linux-amd64-etesync-dav file.

Next we open up a terminal, change our directory to downloads, give the file execute permissions and we can then run for the first time.

$ cd ~/Downloads  
$ chmod +x linux-amd64-etesync-dav
$ ./linux-amd64-etesync-dav
You should now be able to surf to http://localhost:37358/.web/login/, where you will be greeted by a login screen.

Of course, I cannot surf to my account to login as the service is not running yet.

Then the autostart:

Next up, we want to make sure that this program is always started whenever we boot our computer. To do that, we will be using a systemd file.

First, move the binary file to the /usr/local/bin folder.

$ mv linux-amd64-etesync-dav /usr/local/bin/etesync-dav

Next, we create a file called etesync-dav.service. You can place this file anywhere for now. In the file, you should insert the following:

[Unit]
Description=Cal/CardDAV frontend for Etesync

[Service]
Type=simple
ExecStart=/usr/local/bin/etesync-dav

[Install]
WantedBy=default.target

Concretely, this is a systemd service file that lets systemd know that we want it to execute the etesync-dav file in /usr/local/bin. For systemd to see this file, we need to move it first (you might need sudo for this). After moving the file, we will tell systemd to (a) run the program at boot, and (b) run the program now

$ sudo mv etesync-dav.service /usr/lib/systemd/user/etesync-dav.service
$ systemctl --user enable etesync-dav
$ systemctl --user start etesync-dav

The name of the file I downloaded is: linux-amd64-etesync-dav. And that is what I moved to /usr/local/bin where now resides: etesync-dav.

It’s been a long day working and I figured I could at least give it a go before retiring for the evening. Any help much appreciated.

Thanks,
Sheila

Also, do I need to install some “tools?” Using chkconfig returns command not found.

Thanks,
Sheila

Not sure, some ideas

  • did you reboot before trying start?
  • may need to enable it first , before start
  • are you root doing this?
  • permissions on the script?
  • what does status say about this service?

After permissions changed, I still get the following:

myviolinsings@mx--acer:~
$ sudo chown -R myviolinsings /etc/init.d/etesync-dav.service
myviolinsings@mx--acer:~
$ service etesync-dav start
etesync-dav: unrecognized service
myviolinsings@mx--acer:~
$ service etesync-dav.service start
/etc/init.d/etesync-dav.service: 14: /usr/local/bin: Permission denied
myviolinsings@mx--acer:~
$ sudo chown -R myviolinsings /usr/local/bin/etesync-dav
myviolinsings@mx--acer:~
$ service etesync-dav.service start
/etc/init.d/etesync-dav.service: 14: /usr/local/bin: Permission denied

Even with sudo, permission denied. So I used;

sudo chmod 755

for each of the file directories, /etc/init.d/ and /usr/local/bin/

myviolinsings@mx--acer:~
$ service etesync-dav start
etesync-dav: unrecognized service

So I am at a loss as to why it is not starting or unknown unless it is something inside the script of the service file.

Thanks,
Sheila

Further reading leads me to believe this service (run levels) needs to also be in /etc/init.d/rc?.d/, does it not? But I have not found it in any of the levels I gave in the script. (start: 2,3,4,5 & stop: 0,1,6)

To create the links from /etc/init.d/ to the corresponding runlevel directories (/etc/init.d/rc?.d/), enter the command insserv . The insserv program evaluates the INIT INFO header to create the necessary links for start and stop scripts in the runlevel directories (/etc/init.d/rc?.d/). The program also takes care of the correct start and stop order for each runlevel by including the necessary numbers in the names of these links.

Could this be the issue?

Thanks,
Sheila

Can you start it by hand
/etc/init.d/etesync-dav.service start &
You may need a few options… I dont know its options.

That would at least tell you if the script will run

and
What is this .service business? The files in my init.d are just daemon names like
sshd? Did you inherit that .service thing from systemd ? The name should be the command name.

This

says to do the following

sudo update-rc.d celeryd defaults
sudo update-rc.d celeryd enable

Not celeryd of course, your daemon

The etesync-dav.service was the name of the file from sysd, yes. And that is what I kept trying to see if that was the incorrect way to name the actual service file (to denote that it is a service). So maybe I should drop the .service from the script and just call it etesync-dav.

Here is what I got from running the insserv command:

insserv etesync-dav.service
insserv: warning: could not find all dependencies for $dbus
insserv: warning: could not find all dependencies for $dbus
insserv: script etesync-dav.service is broken: incomplete LSB comment.
insserv: missing `Provides:' entry: please add.
insserv: missing `Required-Start:' entry: please add even if empty.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: missing `Default-Start:'  entry: please add even if empty.
insserv: missing `Default-Stop:'   entry: please add even if empty.
insserv: script etesync-dav.service is broken: incomplete LSB comment.
insserv: missing `Provides:' entry: please add.
insserv: missing `Required-Start:' entry: please add even if empty.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: missing `Default-Start:'  entry: please add even if empty.
insserv: missing `Default-Stop:'   entry: please add even if empty.
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `etesync-dav.service'
insserv: Default-Stop  undefined, assuming empty stop runlevel(s) for script `etesync-dav.service'
insserv: fopen(/etc/init.d/.depend.boot): Permission denied

So between correcting the file “name” and the script itself, as well as using the insserv to create the symlinks, maybe I can be successful.

I finally found that

sudo update-rc.d

replaces chkconfig in sysV when not in rhel, etc. So perhaps that command does what “insserv” does?

Sheila

1 Like
sudo update-rc.d etesync-dav enable
update-rc.d: error: etesync-dav Default-Start contains no runlevels, aborting.

But the run levels are in the script.

Default-Start: 2 3 4 5
Default-Stop: 0 1 6

Do they also need to be down in the body of the script?

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
  *)

I will keep working on it later this evening as I have meetings today.

Thanks,
Sheila

man 5 init-d-script