VPS Start service error

neituo6 years ago

i install traccar v.4.2 on digitalOcean Ubuntu 18.04.2 x64, when i try to start service i,m getting thes error

root@ubuntu-s-1vcpu-1gb-blr1-01:~# /opt/traccar/bin/startDaemon.sh
-bash: /opt/traccar/bin/startDaemon.sh: No such file or directory
Carl6 years ago

try using:

$ sudo service traccar start
jackson alves6 years ago
sudo systemctl restart traccar.service
neituo6 years ago

Thanks for the Quick response. I'm new to Linux. I don't know where it went wrong
Here is my second attempt installing log file.

root@ubuntu-s-1vcpu-1gb-blr1-01:~# apt-get update

Hit:1 http://mirrors.digitalocean.com/ubuntu bionic InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://mirrors.digitalocean.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://mirrors.digitalocean.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://mirrors.digitalocean.com/ubuntu bionic-updates/main amd64 Packages [5                                                                                      74 kB]
Get:6 http://mirrors.digitalocean.com/ubuntu bionic-updates/main Translation-en [2                                                                                      11 kB]
Get:7 http://mirrors.digitalocean.com/ubuntu bionic-updates/universe amd64 Package                                                                                      s [755 kB]
Get:8 http://mirrors.digitalocean.com/ubuntu bionic-updates/universe Translation-e                                                                                      n [201 kB]
Fetched 1994 kB in 2s (971 kB/s)
Reading package lists... Done

root@ubuntu-s-1vcpu-1gb-blr1-01:~# apt-get install unzip default-jre mysql-server

Reading package lists... Done
Building dependency tree
Reading state information... Done
default-jre is already the newest version (2:1.10-63ubuntu1~02).
unzip is already the newest version (6.0-21ubuntu1).
mysql-server is already the newest version (5.7.25-0ubuntu0.18.04.2).
The following package was automatically installed and is no longer required:
  grub-pc-bin
Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.

root@ubuntu-s-1vcpu-1gb-blr1-01:~# mysql -u root -p --execute="GRANT ALL PRIVILEGE                                                                                      S on *.* to 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; FL                                                                                      USH PRIVILEGES;"
Enter password:
root@ubuntu-s-1vcpu-1gb-blr1-01:~# echo "create database traccar" | mysql -u root                                                                                       -p
Enter password:
ERROR 1007 (HY000) at line 1: Can't create database 'traccar'; database exists

root@ubuntu-s-1vcpu-1gb-blr1-01:~# wget  https://github.com/traccar/traccar/releas                                                                                      es/download/v4.3/traccar-linux-64-4.3.zip

--2019-04-10 03:24:24--  https://github.com/traccar/traccar/releases/download/v4.3                                                                                      /traccar-linux-64-4.3.zip
Resolving github.com (github.com)... 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/4038949/                                                                                      dc9d1280-2727-11e9-939b-7c45601153a7?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Creden                                                                                      tial=AKIAIWNJYAX4CSVEH53A%2F20190410%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20                                                                                      190410T032425Z&X-Amz-Expires=300&X-Amz-Signature=63d85e590a898d223a80bc5549f5c06e5                                                                                      185c191851c4014f3ef90ac507c5e8a&X-Amz-SignedHeaders=host&actor_id=0&response-conte                                                                                      nt-disposition=attachment%3B%20filename%3Dtraccar-linux-64-4.3.zip&response-conten                                                                                      t-type=application%2Foctet-stream [following]
--2019-04-10 03:24:25--  https://github-production-release-asset-2e65be.s3.amazona                                                                                      ws.com/4038949/dc9d1280-2727-11e9-939b-7c45601153a7?X-Amz-Algorithm=AWS4-HMAC-SHA2                                                                                      56&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20190410%2Fus-east-1%2Fs3%2Faws4_reques                                                                                      t&X-Amz-Date=20190410T032425Z&X-Amz-Expires=300&X-Amz-Signature=63d85e590a898d223a                                                                                      80bc5549f5c06e5185c191851c4014f3ef90ac507c5e8a&X-Amz-SignedHeaders=host&actor_id=0                                                                                      &response-content-disposition=attachment%3B%20filename%3Dtraccar-linux-64-4.3.zip&                                                                                      response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-producti                                                                                      on-release-asset-2e65be.s3.amazonaws.com)... 52.216.135.3
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-prod                                                                                      uction-release-asset-2e65be.s3.amazonaws.com)|52.216.135.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85311790 (81M) [application/octet-stream]
Saving to: ‘traccar-linux-64-4.3.zip’

traccar-linux-64-4.3 100%[====================>]  81.36M  12.3MB/s    in 8.0s

2019-04-10 03:24:34 (10.2 MB/s) - ‘traccar-linux-64-4.3.zip’ saved [85311790/85311                                                                                      790]

root@ubuntu-s-1vcpu-1gb-blr1-01:~# unzip traccar-linux-*.zip
Archive:  traccar-linux-64-4.3.zip
  inflating: traccar.run
  inflating: README.txt
root@ubuntu-s-1vcpu-1gb-blr1-01:~# ./traccar.run
Creating directory out
Verifying archive integrity...  100%   All good.
Uncompressing traccar  100%
root@ubuntu-s-1vcpu-1gb-blr1-01:~# nano traccar.xml

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <entry key="config.default">./conf/default.xml</entry>

    <entry key='web.port'>80</entry>

    <entry key='geocoder.enable'>false</entry>

    <entry key='database.driver'>com.mysql.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://localhost/traccar?allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
    <entry key='database.user'>root</entry>
    <entry key='database.password'>root</entry>
    
    <entry key='server.timeout'>120</entry>

</properties>


root@ubuntu-s-1vcpu-1gb-blr1-01:~# cp traccar.xml /opt/traccar/conf/
root@ubuntu-s-1vcpu-1gb-blr1-01:~# rm -f traccar.run README.txt traccar-linux-*.zi                                                                                      p
root@ubuntu-s-1vcpu-1gb-blr1-01:~# printf '#!/bin/sh\nfind /opt/traccar/logs/ -mti                                                                                      me +5 -type f -delete\n' > /etc/cron.daily/traccar-clear-logs && chmod +x /etc/cro                                                                                      n.daily/traccar-clear-logs
root@ubuntu-s-1vcpu-1gb-blr1-01:~# /opt/traccar/bin/startDaemon.sh
-bash: /opt/traccar/bin/startDaemon.sh: No such file or directory
root@ubuntu-s-1vcpu-1gb-blr1-01:~# sudo service traccar start
root@ubuntu-s-1vcpu-1gb-blr1-01:~# systemctl restart traccar.service
root@ubuntu-s-1vcpu-1gb-blr1-01:~# sudo systemctl restart traccar.service
root@ubuntu-s-1vcpu-1gb-blr1-01:~# $ sudo service traccar start
$: command not found