0

We have a custom program (test) to use the following structure, e.g.

 myapp
 myapp\version1\
 myapp\version1\test
 myapp\version1\logs\..
 myapp\version2\test
 myapp\version2\logs\..
 myapp\running -> version1

And we run like that

 ./mysqpp/running/test

The running symlink is currently pointing to version1, we want to change the symlink to version2 when the program is running, will there be any side effect?

(We dont want to interrupt the current service, just want when the server is restarted next time, it is using version2)

Elrond
  • 556
  • 2
  • 5
  • 16
Ryan
  • 5,341
  • 21
  • 71
  • 87

1 Answers1

2

A clear depends:

The currently running app as itself wont be affected directly, because it is loaded into RAM and backed by its inode on disk. So that's fine.

Problem is, if myapp/version1/test accesses some files by path and uses myapp/running/logs/datafile to access the file. And this is also only a problem if the app opens the file after the symlink has been changed. If it does so, it will of course suddenly open files under myapp/version2.

So short answer: If myapp/version1 has any reference by name to "running", I'd not change the symlink.

Note: So get things changed at the next reboot, you could put up some init.d boot script or a cron @boot thingy.

Elrond
  • 556
  • 2
  • 5
  • 16
  • Thanks, yes, `myapp/version1/test` know nothing about `running` symlink and won't reference it. – Ryan Mar 19 '13 at 16:51
  • Could you consider upvoting/accepting my answer? This is the preferred way of saying "Thank you". – Elrond Mar 27 '13 at 00:19