Alpine Linux:FAQ: Difference between revisions

From Alpine Linux
Line 94: Line 94:


You can make ntpd set the time at startup by adding ''-s'' option to ntpd. This is done by setting '''NTPD_OPTS="-s"''' in ''/etc/conf.d/ntpd''.
You can make ntpd set the time at startup by adding ''-s'' option to ntpd. This is done by setting '''NTPD_OPTS="-s"''' in ''/etc/conf.d/ntpd''.
== Using a cron job to keep the time in sync ==
Add the following to ''/etc/periodic/daily'' (or use another folder if you want to run the script more/less frequently)
Example: file called ''do-ntp''
: {{cmd|#!/bin/sh}}
: {{cmd|ntpd -d -q -n -p uk.pool.ntp.org}}
This queries the uk time server pool - you can modify this to suit your localisation, or just use ''pool.ntp.org''. More info here: [http://www.pool.ntp.org/zone/@ http://www.pool.ntp.org/zone/@]


= Packages =
= Packages =

Revision as of 07:41, 23 March 2011

This is a list of frequently asked questions about Alpine Linux. If your question is not answered on this page, use the search box above to find work in progress pages not linked here, or in case of no answer, edit this page and write down your question.

Tip: Prepare your question. Think it through. Make it simple and understandable.

General

I have found a bug, where can I report it?

You can report it on the bugtracker.

Alpine freezes during boot from Compact Flash, how can I fix?

Most Compact Flash card readers do not support proper DMA. You should append nodma to the append line in syslinux.cfg.

How can I contribute?

You can contribute by using the software and giving feedback. You can contribute by documenting your Alpine Linux experiences on this wiki. You can contribute in many other ways. Please visit Contribute page to read more about this topic.

Your contributions are highly appreciated.

How do I remove the CDROM?

Since the modloop loopback device is on CDROM you cannot just run eject. You need to unmount the modloop first. Unmounting both the modloop and the cdrom in one step can be done by executing:

/etc/init.d/modloop stop

Then it's possible to run eject to eject the cdrom.

Why don't I have man pages or where is the 'man' command?

The 'man' command and man pages are not installed by default.

  • First, install the man package:

apk add man

  • Once that's done, install the documentation for the packages that you require man pages for:
    (Keep in mind, however, it's possible that not all packages will have a corresponding documentation package.)

apk add <pkg>-doc

For example, say you installed iptables and you now require its man pages:

apk add iptables-doc


In our example above, we installed the man pages (and other documentation) for iptables. We can now read it:

man iptables

My cron jobs don't run?

The cron daemon is started automatically on system boot and executes the scripts placed in the folders under /etc/periodic - there's a 15min folder, plus ones for hourly, daily, weekly and monthly scripts.

You can check whether your scripts are likely to run using the command:

run-parts -t /etc/periodic/[foldername]

- for example: run-parts -t /etc/periodic/15min

This command will tell you what should run but will not actually execute the scripts.

If the results of the test are not as expected, check the following:

  • Make sure the script is executable - if unsure, issue the command :

    chmod a+x [scriptname]

  • Make sure the first line of your script is :

    #!/bin/sh

  • Do not put file extensions on your scripts - this stops them from working; for example: myscript will run, but myscript.sh won't

Audio

How do I play my .ogg/.mp3 files?

First, the sound card should be recognized (you must have /dev/snd/***** files)

sox, mpg321, mpg123, oggplay, etc all use the oss sound driver, while Alpine uses ALSA drivers. So you need to load the snd-pcm-oss compatibility module. While you're at it, you might need aumix to turn up the sound volume

echo snd-pcm-oss >> /etc/modules
modprobe snd-pcm-oss 
apk_add aumix sox
aumix (set volume settings)
play really_cool_song.mp3

Time and timezones

How do I set the local timezone?

Starting in Alpine 2.2, a setting the timezone will be part of the setup-alpine script. For previous versions, however:

/etc/timezone and the whole zoneinfo directory tree are not supported.
To set the timezone, set the TZ environment variable as specified in
http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html
or you may also create an /etc/TZ file of a single line, ending with a
newline, containing the TZ setting.  For example
echo CST6CDT > /etc/TZ

Source: http://www.uclibc.org/downloads/Glibc_vs_uClibc_Differences.txt

For more information, see how other uClibc-based distributions do this:

For a more complete list of timezones, please see: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones

OpenNTPD reports an error with "adjtime"

Your log contains something like:

reply from 85.214.86.126: offset 865033148.784255 delay 0.055466, next query 32s
reply from 202.150.212.24: offset 865033148.779314 delay 0.400771, next query 3s
adjusting local clock by 865033148.779835s                                      
adjtime failed: Invalid argument    

openntpd is supposed to make small adjustments in the time without causing time jumps. If the adjustment is too big then something is clearly wrong and ntpd gives up. (its actually adjtime(3) that has a limit on how big adjustments are allowed)

You can make ntpd set the time at startup by adding -s option to ntpd. This is done by setting NTPD_OPTS="-s" in /etc/conf.d/ntpd.

Using a cron job to keep the time in sync

Add the following to /etc/periodic/daily (or use another folder if you want to run the script more/less frequently)

Example: file called do-ntp

#!/bin/sh

ntpd -d -q -n -p uk.pool.ntp.org

This queries the uk time server pool - you can modify this to suit your localisation, or just use pool.ntp.org. More info here: http://www.pool.ntp.org/zone/@

Packages

Can you build an apk package for ...?

Yes, we probably can. Please create an issue in the bugtracker. Mark it as "feature" and include a short description (one-line), an url for the home page, and an url for the source package.

How can I build my own package?

Please see the Creating an Alpine package page.

Dynamic DNS

How do I schedule a regular dynamic DNS update?

You'll want to install the ez-ipupdate package:

apk add ez-ipupdate

After that, create a new file at /etc/ezipupdate.conf with the contents similar to:

service-type=dyndns
user=myusername:mypassword
interface=eth1
host=myhostname.dyndns.org

Make the new ip cache directory:

mkdir /var/cache/ez-ipupdate
lbu add /var/cache/ez-ipupdate

Then schedule a new cron job with this command:

echo >> /var/log/ez-ipupdate && /bin/date >> /var/log/ez-ipupdate && ez-ipupdate --config /etc/ez-ipupdate.conf -f -F /var/run/ez-ipupdate.pid --cache-file /var/cache/ez-ipupdate/ipcache --quiet >> /var/log/ez-ipupdate 2>&1

Don't forget to backup your settings!

lbu ci