个人工具
登录
查看“UbuntuHelp:UbuntuDateBug”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:UbuntuDateBug”的源代码
来自Ubuntu中文
←
UbuntuHelp:UbuntuDateBug
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/UbuntuDateBug}} {{Languages|UbuntuHelp:UbuntuDateBug}} There is a rather annoying bug in Ubuntu which causes it to hang if the date is set badly (before 1970 I think). It is simple to fix, but it's rarely diagnosed properly. It has been reported here: https://launchpad.net/distros/ubuntu/+source/gnome-session/+bug/23426 . It crops up occasionaly in the forums so I have put the info here to point people to. == Symptoms == The system boots fine, and gets to the gdm login screen. The user types name and password and presses enter. The screen goes and the user is left on a brown screen. That's it, just a brown screen of death. If the user is savvy they will try ctrl-alt-f1 and get a text terminal. They might try restarting gdm, reinstalling gnome, creating a new user, deleting all their gnome preference files, reinstalling the whole sytem. They probably won't check the computer clock. == How to fix == Simple, set the date right. Boot to the point of the brown screen, then press crtl+alt+f1 (ctrl-option-F1 on a Mac) to get a terminal, and log in. Type: <pre><nowiki> date </nowiki></pre> if you get something like <pre><nowiki> Fri Jan 11 19:11:32 GMT 1970 </nowiki></pre> then run the command <pre><nowiki> sudo date -s "Fri Nov 11 19:11:32 GMT 2005" </nowiki></pre> (you will need to put in your password) now do the command <pre><nowiki> sudo /etc/init.d/gdm restart </nowiki></pre> and hopefully you can log in. == Why this happens == I believe the bug is related to the way the date is stored and the way c deals with numbers. In unix (and macs) the date is store as the number of seconds since the epoch (1 jan 1970). Negative values represent dates back to 1904. Now of course it is well after 1970, so why bother with being able to set your clock to before 1970. (if you want to store birthdays in a program you might need to, but not for the current date). In c you can store numbers as signed or unsigned. If they are signed they can be negative or positive. Most computers store their time in a signed number, gnome seems to use a signed number, but the kernel seems to use unsigned. So if your computer clock can be set before 1970, most stuff will work fine, however gnome will not boot. Apple Mac computers can be set to dates back to 1904. If the clock in a mac is reset it will go to 1904. The clock in a mac is kept going by the PRAM battery, which runs out after about 5 years. After this time if the mains goes off then the clock will reset, and gnome wont boot. (It can also be reset after a bad crash.) The long term fix on a mac is to replace your PRAM battery. [[category:CategoryDocumentation]] [[category:CategoryCleanup]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:UbuntuDateBug
。