How file locking and package managers work in Linux - linux

Today I encountered a "Text file busy" error when trying to overwrite a running program I made with a newer version.
I thought that UNIX like systems don't automatically lock up running files, so package managers like apt can upgrade those software, even if they are running services.
https://en.wikipedia.org/wiki/File_locking#In_Unix-like_systems
Am I wrong in my understanding?
My environment is Ubuntu, and I use the XFS filesystem.

The Text file busy error in specific is about trying to modify an executable while it is executing. The "Text" here refers to the fact that the file being modified is the text segment for a running program. apt can change file but not edit it

Related

yum install briefly disables shared libraries

I have a set of command line programs that depend on a set of shared libraries. They are called quite often, so in any given second it is likely that one of these programs will be launched.
When I "yum install" a new set of libraries, it often happens that the launch of one of these program will fail with the message
error while loading shared libraries: foo.so.0: cannot open shared object file: No such file or directory
a few moments later, everything is fine again, but the script that might have been running for a few hours has failed.
It sometimes reports several missing libraries, suggesting that yum is not installing them one at a time.
We've recently switched versions of Linux, and therefore yum. This happened only rarely with Centos6 and yum 3.2.29, but much much more often with Linux 4.1.17 and yum 3.4.3.
Is there anything that can be done to ameliorate this behavior? To minimize the amount of time during which a library is missing?

Linux CentOS Server Startscript: Minecraft Server

Recently tried using the following startscript here:
http://dev.bukkit.org/bukkit-plugins/linux-server-startscript-menu/
After installing dos2unix, it says it is installed and using the latest version. I then use the command "dos2unix startserver.sh" and I prompted with the message: "dos2unix: converting file startserver.sh to UNIX format ..." and then it returns to the next blank command line. Problem is there is nothing actually starting the script or I am missing something. I have tried talking to the owner of this script and he helped me to this point, but is unsure what to do next. He says he uses debian and is less familiar with CentOS and so I am posting here.
Here is my script that has been edited according to my server. The most important change I made is SCRIPTUPDATE="0" (so it doesn't update)
Please keep in mind that I am very new to linux and any operating systems in general.
The dos2unix command converts the newline characters in a file from dos format to unix format. This is just for cleaning up a file that may have problems (e.g., from a bad ftp transfer).
Try running the ./startserver.sh command again, now that the file has been cleansed.

/usr/bin/time: No such file or directory

I'm trying to run the time command for a file on a virtual machine running Fedora 19 64-bit and I get the message "/usr/bin/time: No such file or directory". I tried googling, but it appears it's something that I should already have. How do I get this on my computer?
For those on a raspberry pi or similar debian-based distributions, I found that I could install the package time (sudo apt install time) to obtain access to the time command.
Edit: For Fedora-based systems, the package name might be different. Try a dnf search time, followed by a sudo dnf install {package_name}. I don't have a Fedora machine immediately to hand to get the exact package name from.
bash/zsh/modern shells usually implement a basic time command as a builtin. So it won't exist on the filesystem, but time mycommand should work.
If you want the "proper" time command (with more options eg: -l/-v), then you'll need to install it via apt/yum/etc. You'll need to run it as /usr/bin/time mycommand so the shell-builtin doesn't get invoked.
It might be in other locations. I'd start by typing:
which time
This command will give you the path to time, if it's anywhere in your path.
If you need to build it yourself, you can get the source here:
http://directory.fsf.org/wiki/Time

How do i resolve the procedure entry point_impure_ptr error in cygwin/opencobol?

Whenever I try to run my .exe cobol file, i get this error..
fileName.exe Entry Point Not Found
The procedure entry point_impure_ptr could not be located in the dynamic link library cygwin1.dll
I am using OpenCObol and cygwin ver1.7.15.thanks
You'll need to specify the proper path for the command below, but Cygwin seems pretty persnickety with entry point addresses and updates, The system includes a rebaseall command to help fix this problem. Most times I've witnessed it is after a setup.exe pass, while the Cygwin system was still active (and perhaps only in the background and not visible).
C:\Users\btiffin\cygwin\bin\dash -c '/usr/bin/rebaseall'
Run that from a Windows CMD shell (while Cygwin isn't active, say after a clean boot and before running the Cygwin shell. Basically cygwin1.dll can't be open). You'll need to use the proper Windows path to dash for your particular install. Google Cygwin rebase for detailed articles.
I had a similar error message after upgrading from cygwin version 1.5 to 1.7. I solved it by completely removing and reinstalling 1.7 from scratch. I was told there might have been a problem with multiple versions of dlls.

How to set up MIT Scheme for 6.001 in Ubuntu 8.10

I play to self-study 6.001 with the video lectures and lecture handouts. However, I have some problems setting up MIT Scheme in Ubuntu (intrepid).
I used package management and installed MIT-Scheme, but it's obviously the wrong version to use. It should be 7.5.1 instead of 7.7.90
I followed the instructions from this website (http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-001Spring-2005/Tools/detail/linuxinstall.htm)
So far, I've downloaded the tar file, and extracted to /usr/local. I have no idea what step 3 means.
Then I entered command
scheme -large -band 6001.com -edit
and the error is
Not enough memory for this configuration.
I tried to run under sudo mode, and this time the error is different
Unable to allocate process table.
Inconsistency detected
I have close to 1GB of free memory, with ample HDD space. What should I do to successfully set this up?
Step 3 means that you should type export MITSCHEME_6001_DIRECTORY=${your_problems_path}. If you don't want to type it every time you launch Scheme, you should put it as a string in your ~/.bash_profile file(in case you use bash)
About the problem itself, Google instantly suggests a solution:
sudo sysctl -w vm.mmap_min_addr=0(taken from http://ubuntuforums.org/showthread.php?p=4868292)
Instead of the package manager, you may also want to compile the portable C sources for Unix. I am using it happily.

Resources