Paul Coviello · Sep 20, 2022

Linux and links

If I create a link does root use it? (it’s in profile.d dir)

I'm trying to use a shortcut for a filepath as such: anyone have any thoughts?

PROCAUTO  = /JRNDSK/ProcAuto_share

yet in the application it isn't recognizing it.

Here’s the scenario. (link is in place) that my manager thinks maybe an issue.

login as cacheusr

sudo to root

Then start cache. Since this was started as root through cacheusr would cache know about the link? (since it’s running as root)

Product version: Caché 2015.1
$ZV: 2015.2.3 (Build 855_0_16694)
0 143
Discussion (4)1
Log in or sign up to continue

Hi Paul! Nice to see you on the DC.  These questions are hard because there's a lot of"plumbing" to think about.

If I understand things right, you have an environment variable for root set via a script file in /etc/profile.d and that's working at the Linux shell.  But you don't see that at a Cache' terminal even when you start the instance as root.

Caché daemons will run as the instance owner and user jobs would run with the privilege and environment of the user who logs in.  Otherwise, an ordinary user could open a Caché terminal and work with root privilege.  I'm writing this from memory, and Caché 2015.1 is pretty old now, so there might be some other details that are relevant (and which I'm forgetting).

Another issue is that when you use the sudo or su commands to "become root", you don't necessarily get root's environment unless you use the right options for that.  The manpages for sudo and su should help you figure out this.

If you can tell us some more about what you are trying to accomplish with the link, we might be able to help further.  If you are trying to establish links to files that are established when the instance starts and persist, what you need might better be addressed with actions in SYSTEM^%ZSTART or ^ZSTU.  For that, the WRC might also be able to help.

Good luck.  I hope this at least gives you a trailhead to solve the trouble.

Hi Erik,  yes for the most part you have it correct, though we have a link. (the variable wasn't what I wanted) in a nutshell I'm trying to pass the link to the application to write out a report or file. vs the whole file path.  and just to clarify we have been running on VMS for years which allows for logicals and symbols which we then can use for a shortcut. 

I'm still looking to see how to pass a shortcut in, and an export doesn't work either with or without the $ symbol.  and I thought hard links may have been an option but they are not allowed. sigh! 

anyone have any further thoughts ?


Paul ( who is thinking maybe a windows platform may be an option)

Hi Paul, I think you might better talk with the WRC or your Linux distro's support folks depending on whether this works at the Linux shell or not.  Is this trouble with Linux and Caché (start with your vendor) or just with Caché (ask the WRC).  If you have a contact at VMS Software, they might have a reliable solution too.

Something like

PROCAUTO  = /JRNDSK/ProcAuto_share

just sets up a variable, so you can replace the string '/JRNDSK/ProcAuto_share' with $PROCAUTO.  There's nothing fancier than that.  Linux doesn't have a notion of a "shortcut" like Windows does (although some Linux GUI's do give you shortcuts, just at application level) and certainly nothing like VMS logicals.  Soft links and hardlinks are just different ways of giving a file a different name at a different location, so there's nothing to pass in, really.

I still might not be clear on what you are trying to achieve though, and the details matter a bit -- things are a little different if you are using Samba or another shared filesystem and what you're trying to pass the link into.  There may be another way to reach your goal...or maybe not.  VMS is very different from Linux and you've bumped into one of those really nice VMS features that people miss when they move away.

If you are overall trying to migrate from Caché on VMS, I would certainly talk with your account team because there's a lot of learning gained from working with customers who have started that journey.