I have an embedded system where we wish to create custom daylight savings times.
I can achieve this by setting the TZ environment variable, for example: export TZ=IST-2IDT,M3.4.4/26,M10.5.0.
We have several daemons running (eg. daemonA, daemonB, etc.), and if one of those exports TZ then the other daemons won't be able to see it. So that's an issue. A possible work around might be to use a file instead of an environment variable so that 'everyone' can see it.
The GNU C Library manual says the following:
:characters
Each operating system interprets this format differently; in the GNU C Library, characters is the name of a file which describes the time zone.
When I export TZ=:/etc/TZ, and then echo IST-2IDT,M3.4.4/26,M10.5.0 > /etc/TZ, it doesn't work. I see this, when I issue the date command:
Mon Aug 15 04:19:36 /etc/TZ 2016
Is anybody able to give me any clues?
Thanks so much!!
Files such as /etc/TZ depend on the type of system (call them nonstandard as such, though standardization is poor in this area). The usual way timezone is configured is via the /etc/localtime files. Normally these are generated from rule (text) files by the timezone compiler. It is in the tzfile manual page for instance.
The timezone-in-date is a good place to start reading further - since it mentions a few possibilities regarding /etc/TZ. If /etc/TZ is what works for your system, the accepted answer there points to this Oracle page, which appears to document the format.
Related
Am starting my journey exploring TLA+ and more formal software engineering. Am using TLA Toolbox version 1.6.0, however, I notice that neither the inbuilt docs, nor the online docs offer any hints on how to go about editing or setting the default "Author name" used in the auto-generated modification history log.
For example, on my current machine, the logs take the form below...
\* Modification History
\* Last modified Sat Jan 11 12:21:35 EAT 2020 by GAMER
That "GAMER" is the string I wish to modify - say, to my initials. However, though you can manually edit that name inline - in the module editor, immediate you save this change, a new modification comment is inserted into the history with the same former mistake!
How to remedy this? Some environment variable used? A config file or registry value? I would understand that perhaps it reads the system user info or so, but that's not what I have as my system user name either!
./toolbox --launcher.appendVmargs -vmargs -Duser.name=nemesisfixx
Currently I am setting time zone GMT+5 on my Linux CentOS 7 machine by linking /etc/localtime to /usr/share/zoneinfo/Etc/GMT-5.
I want to create a zone info file for example /usr/share/zoneinfo/Etc/GMT-5:30 that enables me to set the current timezone to GMT+5:30 without having to worry about DST changes.
I am aware that I could link /etc/localtime to /usr/share/zoneinfo/Asia/Kolkata for example but then I will have to worry about DST changes even if it may not be implemented in the mean time.
Also I am aware of TZ=GMT+5:30; export $TZ but I am worried that this approach backfire for some reason in the future.
If you don't want to use $TZ variable, you may want to create your own timezone file.
You need create a text file (say MyZone.zic) with
Zone MyZone 5:30 - GMT-5:30
then run
zic -d <desired_folder> MyZone.zic
then link compiled file to /etc/localtime
I use a NASMT Q700 QNAP NAS. For remote monitoring purposes i want to read some values and save them into a database.
Since the web-interface is very complex and full of javascript, i can not scrape it. So I tried to connect to the NAS with SSH.
Which is great, because SSH is one of the methods, that i can connect with automatically with c# and I get back text that I can parse.
The installed Linux system on the box is a :
Linux NASMT 2.6.33.2 #1 Fri Mar 7 11:55:22 CST 2014 armv5tel unknown
I tried to reach my goal:
man is not installed.
smartctl is not installed. (Google told me to try this out)
I went into the /bin and /usr/bin directories and tried everything suspecious. There seems to be a program called nasutil installed. Only that it is not very self documenting. Various calls with different parameters did not work, i always get the same answer:
nasutil multi-call binary
[function] [arguments]...
Current defined functions:
init_nas_cache, init_admin_group, set_file_owner, chk_flash, reset_all, chk10198, get_trusted_domain, update_krb5_ticket
rescan_hd, check_e2key, burn_e2key, cnt_phy_nic, http_link, ip_filter, hdusb_copy, ims, qpkg, gen_upnp_desc, scanafpdb
eset_system, umount_all_vdd, sss_convert, httpd_init, get_hwsn, get_suid, setsum, getsum, rsyslog_util, radius_util, send_alert_mail, rsync_util
acl_cmd check_ldap clean_reset_pwd network_boot_rescan
I used google on this one but could not find anything useful.
I am looking for a command on this linux system without smartctl to give me a list of the installed hard drives with their SMART status.
Has anyone an idea?
Thank you very much in advance!
actually, I was able to find the answer using email and contacts at Fujitsu.
The answer was simple as can be:
# get_hd_smartinfo -d 1
1 is disk 1. Replace with 2 if want to check disk 2.
I did not test it yet, as soon as I have, i'll accept the answer for everyone to see.
Context
I'm building my complete debian system configuration,
so I'm modifying the keyboard and console setups.
I prefer not to modify the base files to keep a maximum
commpatibility and modularity. So I want to use VARIANT
(see setupcon (5)) and load them at init.
But not sure I'm doing it right.
Desired Architecture
I will only use keyboard file for the following example.
There is the base file /etc/default/keyboard
And two possible custom files (according to setupcon (5))
~/.keyboard
/etc/default/keyboard.variant
~/.keyboard
It provides a custom behaviour per $HOME (user)
/etc/default/keyboard.variant
A global and default keyboard setup
I would like to use the three at a time.
Problem
The daemon calling setupcon are console-setup and console-setup-mini
(according to the coments in their initd scripts). They are started
before login shell, so won't know ~/.keyboard.
setupcon needs to be called
setupcon variant
or, looking at the sources, with a variable $VARIANT
VARIANT=variant
What is the best solution to adopt, saving a maximum modularity.
Thank you,
im using httpclient and last-modified header in order to retrieve the last updated date of an html file however when i try this on a linux box it returns yesterdays date but when i use a windows machine it returns todays date. is anyone aware of issues using this header field in linux?
Perhaps, linux server has its clock set differently and this way "lives in the past"?
If you dualboot with Windows, you must make sure your Linux system is configured to not think the BIOS keeps the clock in GMT (or UTC), but in local time. Otherwise your Linux system's clock will keep being off when in Linux.
Also make sure that the /etc/localtime file is a symlink to the correct time zone file under /usr/share/zoneinfo.
After configuring those two things, verify your date and time is correct using the date command and set it correctly if it isn't, via:
date MMDDhhmmCCYY.ss
For example, for the current time at my end (19:41:27 on October 15th 2008) I would use:
date 101519412008.27
Just a thought - perhaps your filesystem was mounted with the noatime option. I'm making the assumption here that your html file wasn't modified, only accessed without changes and the 'updated' time wasn't recorded.
Can you see the timestamp of the file? Is it exactly 1 day out, or just sometime yesterday?
when i look at the date assocaiated with the time it is correct, but then the date that gets displayed after i call the http method is one day behind. Possibly a problem with caching