cancel
Showing results for 
Search instead for 
Did you mean: 

Permissions trouble creating a service with dbsvc under Debian 8

2,924

This is probably something silly due to my inexperience with Debian, but the command:

sudo /opt/sqlanywhere17/bin64/dbsvc -as -t network -s manual -w demosvc -n demo17 /vagrant/DBL/demo.db
returns:
SQL Anywhere Service Utility 17.0.0.1358
You do not have permission to manage services.

The documentation says "You must have permissions on the /etc/init.d directory to create, edit, or delete services.", so I changed the permissions setting on /etc/init.d with:

sudo chmod 777 /etc/init.d
However I still get the error "You do not have permission to manage services.".

I'm running Debian 8 and SA 17.0.0.1358.

I know that Debian is using systemd to manage services, so tried looking through the dbsvc script (and those it calls) and found a script dbsvc_iface_systemd that seems to be initiating the error message when there are no write permissions on a directory /usr/lib/systemd/system, which does not exist on my system. For a lark, I created that directory and tried again. This time it seems to have created the service, but named it SA_.service (I would have expected SA_demosvc.service - the docs say "The naming convention for the service is SA_service-name"). In any case, if I try to start the service with

sudo systemctl start SA_.service
it fails and the journal entries go on about "Failed at step EXEC spawning /usr/bin/rm: No such file or directory" and by now I'm way over my head.

I have created and run SA services many times under Ubuntu with no problems, so this is a bit of a mystery. Any hints on where I've gone wrong, or what I could try next?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Ok, I got it to work by making the following changes to the distribution scripts.

#1: in the file /dbsvc_scripts/utility.sh, in the function escape(), I changed

systemd-escape "$i"
to
systemd-escape "$1"
This seems to fix the problem with the service name only being SA_.service (rather than something like SA_demosvc.service) and I imagine it might work on Vlad mmellon's system, or any installation that uses systemd.

#2: in the file /dbsvc_scripts/dbsvd_iface_systemd, in the function dbsvc_iface_init_systemd(), I changed

/usr/lib/systemd/system
to
/lib/systemd/system
This seems to put the service script in the right place.

#3: in the file /dbsvc_scripts/dbsvd_iface_systemd, in the function dbsvc_iface_create_systemd(), I changed

/usr/bin/rm

to

/bin/rm
This provides the correct path to the rm command.

NOTE: My changes #2 and #3 may only apply to Debian 8 systems - I suspect they might break the script on others :-(.

Former Member
0 Kudos

Thanks for sharing Terry. This should help others ... and will be helpful for planning future platform support.

Answers (0)