We are installing a custom made app that contains some symlinks, but were having the following problem:
Installing it from the web GUI removes all the links breaking the app.
But installing it by copying the app dir into '$SPLUNK_HOME/etc/apps' keeps the symlinks intact, and the app works.
Is this intended behaviour?
Is there anyway to use symlinks inside an app?
If this is a custom app and one you're not intending to publish to Splunkbase, one option is that you could bundle the anaconda environment in its own tgz within the app, and create a custom setup process that will extract that environment. It's clunky but that's an option.
We already tried something similar installing the app directly by extracting its contents to /etc/apps, and it works. But we re eventually going to publish to splunkbase, so thats not an option.
Thanks for commenting.
Why would you want a symlink within an app in the first place? Do you have duplicated files/directories in your app? Seems badly designed. Are you reaching outside of your app? Even worse design - an app should be self-contained so you can move it to another installation.
I wouldn't count on splunk's app unpacker and various methods of app distribution (deployer, deployment server, cluster manager) to preserve symlinks anyway.
Thanks for commenting on this issue.
I know its badly designed but the thing is we need to run some custom commands that uses cython, but Splunk's python doesn't support cython libraries, so we created an anaconda environment inside the app that contains another python3 instance with the cython libraries we need. This anaconda environment automatically creates some symlinks to binaries and libraries inside this environment.
This method of bypassing the Splunks python environment to run not supported libraries was used by the 'Python for Scientific Computing' app (https://splunkbase.splunk.com/app/2882/) and the Splunk Machine Learning Toolkit app (https://splunkbase.splunk.com/app/2890/) and we just copied it. But this implementation removes the symlinks by copying the same binaries and libraries creating duplicated files and wasting disk space.
So we need to find another way to run cython libraries inside Splunk, or keep the anaconda environment and try to make the symlinks work. Or we might just duplicate the bins and libs inside the anaconda just like the apps i mentioned earlier, but im trying to avoid it.