Linux files and scripts on BSD

Need support for GhostBSD. Ask here if your question does not fit elsewhere.
Post Reply
hank2000
Posts: 253
Joined: Mon Sep 16, 2013 9:42 am

Linux files and scripts on BSD

Post by hank2000 »

Hi there

maybe just too stupid or blind to see, but:
I thought I can execute linux commands and/or scripts under BSD when linux compatibility is loaded with kernel.
I had a perfect VMS turnkey system running on openSuse with Hercules and wanted to move it to GhostBSD as Hercules is ported to there, too!
but it says either "command not found" with ./mvs under Bash and "defect interpreter" with Xfce Terminal and also "bad substitution" when trying 'sh mvs'!
Is there a chance to get this script running on Ghost, in the script I see settings for bash and unix unicode etc., so thought there would be a way...

best
Achim
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: Linux files and scripts on BSD

Post by ASX »

hank2000 wrote:Hi there

maybe just too stupid or blind to see, but:
I thought I can execute linux commands and/or scripts under BSD when linux compatibility is loaded with kernel.
Generally speaking yes, this is what Linux support in FreeBSD/GhostBSD is about.
I had a perfect VMS turnkey system running on openSuse with Hercules and wanted to move it to GhostBSD as Hercules is ported to there, too!
A first question: that OpenSuSE was a 32 or 64 bit install ?
linux module provide 32bit support
linux64 module provide 64 bit linux support, but that is only available from 11.x.
but it says either "command not found" with ./mvs under Bash and "defect interpreter" with Xfce Terminal and also "bad substitution" when trying 'sh mvs'!
It seems "mvs" is a shell script ... so check if the hashbang is set properly, i.e.:

Code: Select all

#!/usr/local/bin/bash
also, you can try to use:

Code: Select all

sh -x ./mvs
or

Code: Select all

bash -x ./mvs
and get some more meaningful output/error.
Is there a chance to get this script running on Ghost, in the script I see settings for bash and unix unicode etc., so thought there would be a way...

best
Achim
Other than what suggested above, you may be required to install additional libraries, usually:
prefixed with linux-c6-... for 32bit CentOS 6.x compatibility
or
prefixed with linux-c7... 64bit CentOS 7.x compatibilty.

Probably CentOS provide older libraries compared to openSUSE ... so it depends on your app requirements.

Beside all the above, consider that if your app rely on some specific Linux kernel feature (in example udev subsystem), most likely the app will not work because those features aren't implemented in FreeBSD kernel, not as a direct replacement anyway.
hank2000
Posts: 253
Joined: Mon Sep 16, 2013 9:42 am

Re: Linux files and scripts on BSD

Post by hank2000 »

ASX wrote:
hank2000 wrote:Hi there
I had a perfect VMS turnkey system running on openSuse with Hercules and wanted to move it to GhostBSD as Hercules is ported to there, too!
A first question: that OpenSuSE was a 32 or 64 bit install ?
linux module provide 32bit support
linux64 module provide 64 bit linux support, but that is only available from 11.x.
but it says either "command not found" with ./mvs under Bash and "defect interpreter" with Xfce Terminal and also "bad substitution" when trying 'sh mvs'!
It seems "mvs" is a shell script ... so check if the hashbang is set properly, i.e.:

Code: Select all

#!/usr/local/bin/bash
also, you can try to use:

Code: Select all

sh -x ./mvs
or

Code: Select all

bash -x ./mvs
and get some more meaningful output/error.
Is there a chance to get this script running on Ghost, in the script I see settings for bash and unix unicode etc., so thought there would be a way...

Probably CentOS provide older libraries compared to openSUSE ... so it depends on your app requirements.

Beside all the above, consider that if your app rely on some specific Linux kernel feature (in example udev subsystem), most likely the app will not work because those features aren't implemented in FreeBSD kernel, not as a direct replacement anyway.
til now always had 32bit installations here!
looks like the start options mentioned above (bash -x ./mvs etc.) lead to Your opinion, that it might be for some specific Linux kernel features, as I already found a line with echo "System freebsd not supported" in the mvs-script, which promptly came up when tried this.... what a pity!
two chances now: do it the "hard way" with a tutorial by Jay Mosley, where You start from scratch or using Linux for MVS, Movies and Games... ;-) sniff, back to 70% BSD then.

but thx for the hints, except for the bash parameters, i tried everything else already, so I was NOT too blind to see..... ;-)

it keeps exciting with these "exotic" systems!
cheers
Achim
Post Reply