Skip to content

Commit 4506331

Browse files
committed
updated database location, fix socket
1 parent 94ad260 commit 4506331

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

cmd/cli/ipc_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import (
99
)
1010

1111
func (r *realServiceCommander) WriteToService() error {
12-
socketName := "/tmp/timekeep.sock"
12+
socketDir := "/var/run/timekeep"
13+
socketName := socketDir + "/timekeep.sock"
1314

1415
msg := Command{
1516
Action: "refresh",

scripts/install.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ echo "Installing Timekeep..."
2222
sudo install -m 755 "$BINARY_DIR/timekeepd" /usr/local/bin/
2323
sudo install -m 755 "$BINARY_DIR/timekeep" /usr/local/bin/
2424

25+
sudo mkdir -p /var/lib/timekeep
26+
sudo chmod 755 /var/lib/timekeep
27+
28+
29+
sudo setcap cap_dac_read_search,cap_sys_ptrace+ep /usr/local/bin/timekeepd
30+
2531
sudo tee /etc/systemd/system/timekeep.service > /dev/null <<EOF
2632
[Unit]
2733
Description=TimeKeep Process Tracker
@@ -38,8 +44,6 @@ Group=%G
3844
WantedBy=multi-user.target
3945
EOF
4046

41-
sudo setcap cap_dac_read_search,cap_sys_ptrace+ep /usr/local/bin/timekeepd
42-
4347
sudo systemctl daemon-reload
4448
sudo systemctl enable timekeep.service
4549
sudo systemctl start timekeep.service

sql/db_path_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ package sql
44

55
// Gets database directory path for Windows
66
func getDatabasePath() (string, error) {
7-
return "", nil
7+
return "/var/lib/timekeep/timekeep.db", nil
88
}

0 commit comments

Comments
 (0)