View Single Post
Posts: 1,289 | Thanked: 4,318 times | Joined on Oct 2014
#61
I have updated nodejs.
And, Prey have updated their nodejs version.

There are some small things to be aware of, when trying to update Prey to the latest version thru npm with the new version.
Primarily, they now are using Sqlite for some things.

So, in order to get new version of Prey installed, here is a smmall how-to:

First, uninstall prey.

Code:
sudo npm remove prey -g --unsafe-perm
Next, install new nodejs from http://repo.merproject.org/obs//home...la.armv7hl.rpm
Either download, and use rpm, pkcon install-local or, add my repository.

Update npm to latest version:

Code:
sudo npm install npm@latest -g
nan, and node-gyp (needed to compile sqlite) seems to be missing, and not installed by prey, so do that

Code:
sudo npm install nan -g --unsafe-perm
sudo npm install node-pre-gyp -g --unsafe-perm
Now, install prey

Code:
sudo npm install prey -g --unsafe-perm

Add systemd services, if you want to enable it by default

Code:
sudo nano /etc/systemd/system/prey-agent.service
Code:
[Unit]
Description=The Prey daemon.
After=network.target

[Service]
ExecStart=/usr/lib/node_modules/prey/bin/prey
WorkingDirectory=/usr/lib/node_modules/prey
Restart=always
RestartSec=15
User=prey
Environment="TERM=dumb" "USER=prey"
KillMode=process
TimeoutStopSec=20
KillSignal=QUIT

[Install]
WantedBy=multi-user.target
Ensure, that prey have permissions to use sudo, when needed (to access sqlite db, iwlist, and su

Code:
sudo nano /etc/sudoers.d/50_prey_switcher
Code:
prey ALL = NOPASSWD: /bin/su [A-z]*, !/bin/su root*, !/bin/su -*, /usr/sbin/iwlist
start prey (first reload systemd daemons)

Code:
sudo systemctl daemon-reload
sudo systemctl start prey-agent
Now, it should be working, and if you want to enable auto on reboot:

Code:
sudo systemctl enable prey-agent
Attached Images
 
 

The Following 10 Users Say Thank You to nieldk For This Useful Post: