Right now, if the user specifies the -a flag, the application will crash.
Currently there is no mechanism to differentiate between
1) Running in foreground mode, and a user path is provided.
2) Spawned as a child, and the path is auto generated by the parent.
In case 1, we must not touch the directory.
In case 2, we have to clean it up at shutdown.
This function is responsible for setting up the cleanup functions. It will fail if the parent directory already exists.
Right now, if the user specifies the -a flag, the application will crash.
Currently there is no mechanism to differentiate between 1) Running in foreground mode, and a user path is provided. 2) Spawned as a child, and the path is auto generated by the parent.
In case 1, we must not touch the directory. In case 2, we have to clean it up at shutdown.
This function is responsible for setting up the cleanup functions. It will fail if the parent directory already exists.