Webmin cron does not use files from home directory? - cron

I have Webmin installed on WSL. And I'm trying to run a cron, from Webmin, which references a file in my home directory. However, it produces an error because the path to the file is prefixed with /usr/share/webmin/cron/. It otherwise runs fine when it's triggered by the schedule.
Error: Cannot find module '/usr/share/webmin/cron//home
I've got this to work previously with Webmin somehow, but can no longer find the solution.
Is there any way to allow Webmin to run crons with references to the home directory?

Related

why '~' tilde directory is created automatically in home directory on AWS EC2 instance

I have some python scripts running on AWS-ec2 instance on crontab. Every day I found "~" directory in my home directory. Don't know why this happening.
I have to manually remove the ~ (tilde) directory from home-dir.
When I run these script on local ubuntu machine. It's working fine.
There is a bug in the one of the scripts that you are running that is creating this.
Typical shells ~ is used to refer to the users home. And somewhere this is being used where is is not really replaced. Because these are python scripts you might need to manually handle those.
See - How to get the home directory in Python?

Spring Tool Suite 3.8.2 - Installation on Ubuntu

I managed to install STS 3.8.2 on Ubuntu 16.04 - with a lot of hacking experiments. I have it working, but I am not happy with my solution.
Here is what I had to do:
Extracted the tar file into /opt/sts-bundle.
If you put it anywhere else, like /opt/sts, the TC server fails to start from STS.
With files in /opt/sts-bundle, TC server still fails to start from STS - permission errors. To get it to work you need to futz around with permissions of the pivotal-c-server subdirectories, essentially you need to open it up your group (the same one running STS) (security hole ?).
A local install in your own ~/sts-bundle fails on "files not found" while attempting to backup - all the conf files. It still looks in /opt/sts-bundle for all these config files (just to copy them to /backup). You can change the top directory of the server in STS server properties - but it still looks in /opt/sts-bundle. Seems hard-coded - don't know where. So you have to create all the config files in the conf directory in the tree rooted at /opt/sts-bundle ("touch" works - creating empty files). TC Server still fails to start with a "failed to clean" error - with no clue from the detailed message what files are being "cleaned".
I tried creating a non-privileged user "tcserver" per suggestion from the Pivotal TC Server docs. I installed to /opt/sts-bundle, while logged in as tcserver (with sudo privileges). That fails when I am using STS as a regular developer that is not "tcserver". Could not figure out how to tell TC server to run under a different user than the one that started STS.
The solution I have working and I am not happy with, starts by extracting the tar.gz file into /opt/sts-bundle, as it wants. Then changing owner and group of sts-bundle to my id and my group (same ones that are used in STS UI). I am not happy with that. It seems wrong to put things in /opt that are owned by a single developer.
I am new to Linux, and I still have some Windows habits that need to be unlearned.
The question is: how do I get the clean solution (installing using a "tcserver" user in the global /opt directory) to work for developers who are not "tcserver"? How should the tcserver user be related to the developers (same group?).
Am I making this problem harder than it should be? What am I missing?
I'm not sure this what you want, but I don't install the STS bundles in some kind of shared directory as a special user at all. I just install it in my user.home dir, as myself, and launch it from there.
It is very unsophisticated. I just download the tar.gz file, unpack it in my home dir and then launch it from a trivial bash script which looks something like this:
#!/bin/bash
/home/kdvolder/Applications/sts-bundle/sts-*/STS
That script is on my PATH. So I can just type 'STS' in a terminal and STS will start.
I don't have to do anything else and it works.
If you are trying to somehow install this so that several different users can run a shared installation then this isn't a good setup. But I think for your own personal laptop or desktop which only you are using, this simple setup is perfectly fine.
For a shared-user env, unfortunately, I don't know how to help you. It could be complicated to sort out all the permissions issues etc because Eclipse is a complicated beast w.r.t to installation of plugins etc.

Can I delete the Matlab installation file in root user home directory

I just found Matlab (2016a) put a 2.5 Gb installation files that it fetched during the installation in the root home directory (Linux mint 18), under /root/Downloads/MathWorks. I guess it is probably because I use sudo for installation.
My question is:
Is it normal that program store information when user executes it with sudo?
Can I delete the file under /root/Downloads? (My limited Linux knowledge told me do not touch anything in the /root folder)
When you execute anything with su...do, you basically execute it 'as' root.
Mathworks uses the Download-Folder (which is in your case /root/Downloads - since you have executed the installer as root) for temporary data (According to https://de.mathworks.com/matlabcentral/answers/229835-is-the-mathworks-folder-necessary-to-run-properly?requestedDomain=www.mathworks.com).
So, yes. It seems like you can delete the folder.
Or just move it to MathWorks.bak and check if Mathworks still works properly. In case everything is working fine, you can delete MathWorks.bak.
A program can do anything when run as sudo and depends only on what the program is designed to do. sudo simply elevates the permissions when running a given command.
I would have thought that the installer would have downloaded everything to /tmp instead of /root/Downloads, but as long as you didn't select /root/Downloads as your installation directory for MATLAB and this is only the temporary download location you can certainly remove it after successfully installing MATLAB to a "typical" location such as /usr/local/MATLAB/R2016a.

Lsyncd did not create a lsyncd.pid file

I just installed lsyncd-2.1.5 on a CentOS 6.4 server. I was able to run make and make install on the distribution to compile the daemon. I was able to setup the following configure file at /etc/lsyncd.lua. I was able to setup the daemon file at /etc/init.d/lsyncd. I was also able to setup the logs correctly. However, when I go to run start command on lsyncd, it throws the error:
/bin/bash: line 1: Illegal Insruction /usr/local/bin/lsyncd -pidfile /var/run/lsyncd.pid /etc/lsyncd.lua
I checked at /var/run for the file lsyncd.pid and this file was not created by lsyncd.
Any thoughts on what I should do here? Can I get this file created? Do I have to reinstall?
Let me know if I can provide any further information.
Here is what I did to solve this issue. I removed all instances of my lsyncd distribution. I had previously downloaded and compiled my package in the folder /var/tmp, so I now navigated to the root folder and ran my download command here. I un-tarred the package, and compiled the package in the root folder and setup all of my configuration files. After I started the service now, the lsyncd.pid file was now in the /var/run folder. Very strange. Can anyone tell me what the difference is between compiling in the root or /var/tmp?
Or is this possibly a situation where something possibly went wrong the first time around? Does anyone have any insight on this?

.bashrc in Cygwin 1.7

I'm running Cygwin 1.7.17 on Windows Server 2012. My user account is "Administrator". Where should I put a .bashrc file for the Cygwin bash to pick it up?
I've tried the "c:\users\Administrator" folder, which seems to be the HOME in Cygwin 1.7. Tryed c:\cygwin\home\Administrator also.
Start a shell instance and run the command echo $HOME to see what your home path is set to. That's where all your user config files will be read from. It might not be one of the paths you tried.
Once you know where it is, just copy the template .bash_profile and .bashrc files from the /etc/skel folder to get you started.
If you don't like the path that's currently being used as your home, you can change it by editing /etc/passwd. Here's more info on that... Safely change home directory

Resources