Tiny Core Linux
Tiny Core Extensions => TCE Talk => Topic started by: remus on February 19, 2012, 11:25:12 PM
-
Hi all,
The tinycore based samba server is up and running for two weeks now, and is working well.
I've tested a few different combinations of tinycore and samba and have come up with the following stable recipie.
Tinycore v 3.8.4
Samba v 3.4.5
I'm storing my tce folder on a small partition I created as our community centre does not have enough usb flash drives to spare.
Bit of forum searching uncovered the tce-setdrive command, which allowed me to set the tce folder without the gui :)
I am going on a trip with the church in April to a hospital they are setting up in the solomon islands and am considering installing tinycore+samba as a file server for them. Does anyone know if there is a tc extension that sends regular system status via email ? I've found nagios with google, and it looks ok, if there is nothing already available, i'll make it into an extension. They have internet via satellite at the site.
-
Hi remus
Depending on what you are trying to do, you might be able to set up a script to gather the information you wish
to monitor. Use cron to run it once a day, and possibly alpine to send an email.
-
Hi Rich,
I guess I could do it with shell scripts.
I have a bit of learning to do here.
- enabling emailing in tinycore
- gathering system status, samba logs, hard drive health status
- emailing it out of tinycore
Hmm looks achievable.
Whats the best approach to gathering system satus information, and putting it into an email ?
-
Hi remus
It depends on what kind of data you wish to gather. In general, the script would start by creating a temporary
work directory.
1. mkdir workdirectory
2. Copy any required log files to it. (Samba, dmesg > filename, syslog, etc.)
3. Use the hdparm utility for drive information (hdparm [switches] > filename)
4. Use ifconfig > filename to check for excessive network errors
5. tar zcf workdirectory.tar.gz workdirectory (assumes you are just above workdirectory when executed)
That should give you a starting point. Sorry, I don't have any experience with automating emails, maybe
someone else will offer some advice.
-
Try logwatch http://sourceforge.net/projects/logwatch/ (http://sourceforge.net/projects/logwatch/)
Unfortunately it is not in the repo but it is written in Perl, so no need to compile.
-
Thanks for the Logwatch link, I'll check it out tonight.
Heres another tool that looks interesting: http://mmonit.com/monit/ (http://mmonit.com/monit/)
I've started the build process and ran into problem's, I'll post some of the error messages when i get home tonight.
-
I got a bunch of odd make errors when I tried to build monit, sorry but I'll post proper examples when I get home, it had something to do with PAM is that a part of an existing extension ?
-
Hi remus
There is the Linux-PAM.tcz extension as well as the dev version.
-
How did you find that Rich ?
I searched for pam and PAM with ab with no luck.
I just now tried with the wild card *PAM and *pam but that did not work. Experimented with wild cards and they do seem to work
In the past I've browsed the repository here : http://distro.ibiblio.org/tinycorelinux/4.x/x86/tcz/ (http://distro.ibiblio.org/tinycorelinux/4.x/x86/tcz/) but that takes a bit of bandwidth to load.
-
Hi remus
In this case I used the provides function to search for pam. That function searches for a match anywhere in the files list.
Just be aware that this type of search can return many other extensions as well.
-
Can you give me an example ?
I've googled "Linux provides function" which returns a staggering amount of hits about how great linux is :) but nothing about how to search through the repository file list.
-
Linux does not have a provides function.
Perhaps your time would be better spent reading the wiki and searching the fora.
-
Hi remus
Sorry, I left out the part about opening AppBrowser, and then changing the search button to Provides.
-
Thanks Rich.
-
OT: In a little we will have the tag and this should not happen again! :D
-
monit.tcz has been added to the repo.
I'm going through the monit documentation and it says
Using init to start Monit is probably the best way to run Monit if you want to be certain that you always have a running Monit daemon on your system.
To setup Monit to run from init, you can either use the set init statement in Monit's control file or use the -I option from the command line. Here is what you must add to /etc/inittab:
# Run Monit in standard run-levels
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc
After you have modified init's configuration file, you can run the following command to re-examine /etc/inittab and start Monit:
telinit q
For systems without telinit:
kill -1 1
I was just adding "sudo monit" to the /opt/bootlocal.sh file and that seems to work just fine.
I found this about init
Definition: Init: The first process to run immediately after the operating system loads. It starts the system in single-user mode or spawns a shell to read the startup files, and opens ports designated as login ports.
Any comments about this would be appreciated.
-
Hi remus
That sounds like the right way to go, though you don't need to use sudo.
The calling sequence goes:
/init->/etc/inittab->/etc/rcS->/etc/init.d/tc-config->/opt/bootsync.sh->/opt/bootlocal.sh
If the sequence fails before reaching bootsync.sh or bootlocal.sh you won't have network support.
Without the network, monit can not send an email, so placing it in inittab won't really buy you anything.
Even if you wanted to modify inittab and add it to your backup, I don't know if the restore function
occurs early enough in the boot process for that to work.