1. call-services1是什么意思
call services1
电话服务1
call service
呼叫服务
双语对照
例句:
1.
We have also increased the number and training for call service operators
.
-----------------------------------
如有疑问欢迎追问!
满意请点击右上方【选为满意回答】按钮
2. Linux,centos 7,搞不定telnet
先告诉你函数公式。
修改配置文件:#vi /etc/xinetd.d/telnet将 disable = yes 修改为 disable = no#打开23端口#service xinetd restart
把centos 7服务启动改为 systemd并且启动。
这样应该可以用telnet了服务了。
3. centos7.0安装nfs后无法开机启动
start 就够了,用不着再做enable,再说nfs服务也不支持enable
4. 如何提高Service的优先级避免被杀死或者杀死后如何再次重启Service
我们知道,当进程长期不活动时,如果系统资源吃紧,会杀死一些Service,或不可见的Activity等所在的进程。
如何避免Service被系统杀死,随便在网上搜一下,都能搜到好几种方法,但是每一种方法都有不同的适用环境。
1. 添加android:persistent="true"
添加android:persistent="true"到AndroidManifest.xml,Google文档描述如下:
Whether or not the application should remain running at all times-true" if it should, and "false"if not. The default value is "false". Applications should not normally set this flag; persistence mode is intended only for certain system applications.可见这个属性不能随便用,到目前为止,我所发现使用该属性的应用只有Phone,而且使用是要求权限的,所以这个属性对第三方应用来说意义不是很大;
2. 设置onStartCommand()的返回值
这个思路比较有用,我们着重分析一下,该方法有四种返回值:
START_STICKYSTART_NOT_STICKYSTART_REDELIVER_INTENTSTART_STICKY_COMPATIBILITY
Google官方解释如下,有兴趣的可以展开看看:
/** * Constant to return from {@link #onStartCommand}: compatibility * version of {@link #START_STICKY} that does not guarantee that * {@link #onStartCommand} will be called again after being killed. */ public static final int START_STICKY_COMPATIBILITY = 0; /** * Constant to return from {@link #onStartCommand}: if this service's * process is killed while it is started (after returning from * {@link #onStartCommand}), then leave it in the started state but * don't retain this delivered intent. Later the system will try to * re-create the service. Because it is in the started state, it will * guarantee to call {@link #onStartCommand} after creating the new * service instance; if there are not any pending start commands to be * delivered to the service, it will be called with a null intent * object, so you must take care to check for this. * * This mode makes sense for things that will be explicitly started * and stopped to run for arbitrary periods of time, such as a service * performing background music playback. */ public static final int START_STICKY = 1; /** * Constant to return from {@link #onStartCommand}: if this service's * process is killed while it is started (after returning from * {@link #onStartCommand}), and there are no new start intents to * deliver to it, then take the service out of the started state and * don't recreate until a future explicit call to * {@link Context#startService Context.startService(Intent)}. The * service will not receive a {@link #onStartCommand(Intent, int, int)} * call with a null Intent because it will not be re-started if there * are no pending Intents to deliver. * * This mode makes sense for things that want to do some work as a * result of being started, but can be stopped when under memory pressure * and will explicit start themselves again later to do more work. An * example of such a service would be one that polls for data from * a server: it could schedule an alarm to poll every N minutes by having * the alarm start its service. When its {@link #onStartCommand} is * called from the alarm, it schedules a new alarm for N minutes later, * and spawns a thread to do its networking. If its process is killed * while doing that check, the service will not be restarted until the * alarm goes off. */ public static final int START_NOT_STICKY = 2; /** * Constant to return from {@link #onStartCommand}: if this service's * process is killed while it is started (after returning from * {@link #onStartCommand}), then it will be scheduled for a restart * and the last delivered Intent re-delivered to it again via * {@link #onStartCommand}. This Intent will remain scheduled for * redelivery until the service calls {@link #stopSelf(int)} with the * start ID provided to {@link #onStartCommand}. The * service will not receive a {@link #onStartCommand(Intent, int, int)} * call with a null Intent because it will will only be re-started if * it is not finished processing all Intents sent to it (and any such * pending events will be delivered at the point of restart). */ public static final int START_REDELIVER_INTENT = 3;
View Code
那么简单的说,四种模式的区别如下:
START_STICKY:kill后会被重启,但是重启后调用onStarfCommand()传进来的Intent参数为null,说明被kill的时候没有保存Intent;
START_STICKY_COMPATIBILITY:START_STICKY的兼容版,但是不能保证onStartCommand()方法被调用,如果应用程序的targetSdkVersion 小于 2.0版本,就会返回该值,否则返回START_STICKY,同时再次启动时只会调用onCreate(),不保证能调用onStartCommand()方法,代码如下:
1 public int onStartCommand(Intent intent, int flags, int startId) {2 onStart(intent, startId);3 return mStartCompatibility ? START_STICKY_COMPATIBILITY : START_STICKY;4 }5 =================================6 mStartCompatibility = getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.ECLAIR;7 =================================8 public static final int ECLAIR = 5; // 对应SDK2.0版本
START_NOT_STICKY:kill之后不会被重启;
START_REDELIVER_INTENT:kill后会被重启,同时重启调用onStartCommand()时再次传入保存的Intent。
启动一个service,然后在recent app里面杀死该进程,使用不同返回值时的log如下:
START_REDELIVER_INTENT
D/PlayerService(16907): onCreate------D/PlayerService(16907): onStartCommand------and startId = 1D/PlayerService(16907): onStartCommand------and intent = Intent { cmp=com.example.bitmapfun/.ui.PlayerService }W/ActivityManager( 868): Scheduling restart of crashed service com.example.bitmapfun/.ui.PlayerService in 7776msI/ActivityManager( 868): Start proc com.example.bitmapfun for service com.example.bitmapfun/.ui.PlayerService: pid=17271 uid=10153 gids={50153, 1028}D/PlayerService(17271): onCreate------D/PlayerService(17271): onStartCommand------and startId = 1D/PlayerService(17271): onStartCommand------and intent = Intent { cmp=com.example.bitmapfun/.ui.PlayerService }
被杀死的时候没有调用onDestory()方法,ActivityManager负责安排重启该service,此次重启大概需要7776ms,但这个时间不固定,有时很短,几秒,有时很长,可能要几十秒;
START_STICKY
D/PlayerService(17620): onCreate------D/PlayerService(17620): onStartCommand------and startId = 1D/PlayerService(17620): onStartCommand------and intent = Intent { cmp=com.example.bitmapfun/.ui.PlayerService }W/ActivityManager( 868): Scheduling restart of crashed service com.example.bitmapfun/.ui.PlayerService in 5000msI/ActivityManager( 868): Start proc com.example.bitmapfun for service com.example.bitmapfun/.ui.PlayerService: pid=18003 uid=10153 gids={50153, 1028}D/PlayerService(18003): onCreate------D/PlayerService(18003): onStartCommand------and startId = 3D/PlayerService(18003): onStartCommand------and intent = null
同上,不过传入的Intent为null,同时startId发生了变化,startId的官方解释是“A unique integer representing this specific request to start. Use with stopSelfResult(int)”,也就是说重启和第一次启动不是同一个request,也可以认为这是一个全新的request;
START_STICKY_COMPATIBILITY
D/PlayerService(18177): onCreate------D/PlayerService(18177): onStartCommand------and startId = 1D/PlayerService(18177): onStartCommand------and intent = Intent { cmp=com.example.bitmapfun/.ui.PlayerService }W/ActivityManager( 868): Scheduling restart of crashed service com.example.bitmapfun/.ui.PlayerService in 5000msI/ActivityManager( 868): Start proc com.example.bitmapfun for service com.example.bitmapfun/.ui.PlayerService: pid=18578 uid=10153 gids={50153, 1028}D/PlayerService(18578): onCreate------
这次重启根本就没有调用onStartCommand()方法;
START_NOT_STICKY
D/PlayerService(19436): onCreate------D/PlayerService(19436): onStartCommand------and startId = 1D/PlayerService(19436): onStartCommand------and intent = Intent { cmp=com.example.bitmapfun/.ui.PlayerService }W/ActivityManager( 868): Scheduling restart of crashed service com.example.bitmapfun/.ui.PlayerService in 29285ms
没有再次启动被杀掉的service。
5. Linux启动 V N C 服务是遇到错误
vncserver设置请参考
moralistxp.blog.163.com/blog/static/116110398200951111260458
linux不支持windows的rdp远程控制
linux可以使用rdp来远程控制windows机
6. service vsftpd start 提示:Redirecting to /bin/systemctl start vsftpd.service
分析如下:
1、原因:估计是使用的是Centos7或者 Fedora高版本。启用服务变化了。
2、解决方法:执行命令使用:#/bin/systemctl start vsftpd.service。
3、centos7里面是systemctl start sshd或systemctl start sshd.service。因为centos6里面用的是init来管理服务的,现在centos7改成systemd来管理。你自己安装服务的时候里面会有说明的,会告诉你怎么启动。所有的服务都放在/usr/lib/systemd/system里面的,你不知道的话用man , info , 或者到/usr/share/doc里面去查,网络配置文件/etc/sysconfig/network里有错误,改一下就好了。
扩展资料:
①vsftpd 是以一般身份启动服务,所以对于 Linux 系统的使用权限较低,对于Linux 系统的危害就相对的减低了。此外, vsftpd 亦利用 chroot() 这个函式进行改换根目录的动作,使得系统工具不会被vsftpd 这支服务所误用;
②任何需要具有较高执行权限的 vsftpd 指令均以一支特殊的上层程序( parent process ) 所控制 ,该上层程序享有的较高执行权限功能已经被限制的相当的低,并以不影响Linux 本身的系统为准;
③所有来自 clients 端,想要使用这支上层程序所提供的较高执行权限之vsftpd 指令的需求,均被视为『不可信任的要求』来处理,必需要经过相当程度的身份确认后,方可利用该上层程序的功能。例如chown(), Login 的要求等等动作;
④此外,上面提到的上层程序中,依然使用 chroot() 的功能来限制使用者的执行权限。
参考资料:vsftpd_百度百科
7. Soagent和callservicesd是什么东西,占用了大量资源
forums.developer.apple.com/thread/6160
或者谷歌搜索这两个进程名就有答案。。Apple Developer Forums貌似有挺多人反映这个问题
8. python程序执行报错,请大神帮忙看下
支持xhkczxzz.
再来一个:
#!/usr/bin/env python# coding: utf-8## filename: triangle.py# date: Feb., 2014# author: Tim Wangclass Triangle(object): def __init__(self, a, b, c): self.lines = sorted([a, b, c]) if self.lines[0] + self.lines[1] B: category += u"锐角" else: category += u"钝角" return category + u"三角形" def perimeter(self): """周长""" return self.lines[0] + self.lines[1] + self.lines[2] def area(self): """面积(海伦公式)""" p = sum(self.lines)/2. return (p * (p - self.lines[0]) * (p - self.lines[1]) * (p - self.lines[2]) ) ** .5 def R(self): """外接圆半径""" return (self.lines[0] * self.lines[1] * self.lines[2] ) / (4 * self.area())tr = Triangle(3, 4, 5)print tr.perimeter()print tr.area()print tr.R()print tr.category().encode("utf-8")