Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base node libtor does not clean up temporary files on exit #6739

Open
leet4tari opened this issue Jan 13, 2025 · 3 comments
Open

base node libtor does not clean up temporary files on exit #6739

leet4tari opened this issue Jan 13, 2025 · 3 comments

Comments

@leet4tari
Copy link
Contributor

Running minotari_node on Linux creates files in /tmp folder, looks to be tor related and does not clean up after exit.

root@efe92d8f38bb:/work/unzip# ls -la /tmp/
total 20
drwxrwxrwt 1 root root 4096 Jan 13 12:59 .
drwxr-xr-x 1 root root 4096 Jan 13 12:47 ..
-rw-r----- 1 root root   64 Jan 13 12:59 .tmpbzfa2h
drwx------ 3 root root 4096 Jan 13 12:59 .tmplItJDU
root@efe92d8f38bb:/work/unzip# cat /tmp/.tmpbzfa2h
Jan 13 12:59:34.000 [notice] Tor 0.4.7.13 opening new log file.
root@efe92d8f38bb:/work/unzip# ls -la /tmp/.tmplItJDU/
total 20
drwx------ 3 root root 4096 Jan 13 12:59 .
drwxrwxrwt 1 root root 4096 Jan 13 12:59 ..
-rw------- 1 root root   21 Jan 13 12:59 control_port
drwx------ 2 root root 4096 Jan 13 12:59 keys
-rw------- 1 root root    0 Jan 13 12:59 lock
-rw------- 1 root root  203 Jan 13 12:59 state

Even cleaning out tari folder and running with libtor disabled:
./minotari_node -b ./tari/ --disable-splash-screen -p use_libtor=false

Still find new temporary files and folder after exit.

Expected behavior
Temporary files should be deleted on exit. This becomes a problem with disk space be used by files that are not need. Becomes a big problem, if base node is re-started often.

Desktop (please complete the following information):

  • OS & Version: Ubuntu 24.04.1 LTS
  • Tari suite Version: tari_suite-1.9.2-pre.0-98a76e5-linux-arm64
@leet4tari
Copy link
Contributor Author

Example of /tmp folder after a few restarts

root@efe92d8f38bb:/work/unzip# du -ch /tmp/.tmp*
4.0K	/tmp/.tmp0ukolz
4.0K	/tmp/.tmpJjoB7K/keys
12M	/tmp/.tmpJjoB7K
4.0K	/tmp/.tmpUdKxTx/keys
16K	/tmp/.tmpUdKxTx
4.0K	/tmp/.tmpXL75rO/keys
16K	/tmp/.tmpXL75rO
4.0K	/tmp/.tmphwcrco
4.0K	/tmp/.tmpn6w7JO/keys
24M	/tmp/.tmpn6w7JO
4.0K	/tmp/.tmpof73ki
4.0K	/tmp/.tmpq6YAU7/keys
2.8M	/tmp/.tmpq6YAU7
4.0K	/tmp/.tmptc7tje
4.0K	/tmp/.tmpxchcn8
38M	total

@leet4tari
Copy link
Contributor Author

This looks to be happening on OSX too, but is a little hard to find the OSX tmp folder

leet@leet-tari-m1pro ~ % ls -lda /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmp*
-rw-r-----@ 1 leet  staff   64 Jan 13 17:15 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmp1nrsh4
drwx------@ 9 leet  staff  288 Jan 13 17:31 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmp6rSJH4
drwx------@ 9 leet  staff  288 Jan 13 13:31 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmpHbCj7d
drwx------@ 9 leet  staff  288 Jan 13 17:15 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmpZjBRMK
-rw-r-----@ 1 leet  staff   64 Jan 13 17:17 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmpjvzhaa
-rw-r-----@ 1 leet  staff   64 Jan 13 13:30 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmprmg0ss

I found this by running minotari_node, then finding the PID of minotari_node. Using the PID then checked all open files held by the PID and looking for anything that starts with /.tmp/

leet@leet-tari-m1pro ~ % lsof -p 75377 |grep -i "/.tmp"
minotari_ 75377 leet   21w     REG               1,16       64            66802070 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmpjvzhaa
minotari_ 75377 leet   22u     REG               1,16        0            66802072 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmp6rSJH4/lock

@leet4tari
Copy link
Contributor Author

These files created in the /tmp or related folder in OSX, seem to be hard coded and not controllable by the user. Would be nice if the user had some control over the name and location, so that clean up and be more controlled for more custom setups, like where a /tmp is not writable by the user would break running.

root@efe92d8f38bb:/work/unzip# ./minotari_node -b ./tari/ --disable-splash-screen -p use_libtor=false
Initializing logging according to "./tari/esmeralda/config/base_node/log4rs.yml"
ExitError { exit_code: IOError, details: Some("No such file or directory (os error 2) at path \"/tmp/.tmpSe6dfT\"") }
13:32 ERROR Exiting with code (108): ExitError { exit_code: IOError, details: Some("No such file or directory (os error 2) at path \"/tmp/.tmpSe6dfT\"") }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant